Possible Duplicate:
Convert a string to number and back to string?
I have a string that looks like:
AhgRtlK==
and I need to be able to encrypt and decrypt this string into numbers that might look like this:
1275653444
It’s like phone charge credit (some thing like that)
EDIT :
i want to create some thing like mobile charge credit that contains value of credit card
but encrypted
I don’t think you understand the problem well enough to ask the right question. To the extent I understand what you’re saying, it’s not well thought out. Suppose some code meant a credit of $500. Well, it would always mean that, today, tomorrow, and forever, even after I spent some of it.
So you don’t want codes that decrypt to values. You want codes that identify unique accounts that have balances. (There are great algorithms to do that, and they’re generally based on HMACs.)