-1

I want to encrypt a number in android, for example 12345. How can I encrypt the number?

user1196969
  • 335
  • 2
  • 5
  • 14

3 Answers3

1

Converting to a string and then encrypting a string would probably help you out!

I suggest you check this post:

How to hash a string in Android?

Be sure you check ALL the answers! The first one is flawed and fixed in the second.. Which is again fixed in the 3rd.. Make sure you check through the entire thing before actually starting!

There's also a post here: http://www.androidsnippets.com/encryptdecrypt-strings

This one is about AES encryptions instead though.

Hope this helps!

Community
  • 1
  • 1
Chikilah
  • 490
  • 2
  • 8
0

You can encrypt numbers as same in java by including the libraries of java and make a try go through some java encryption programs that will help you!!!!!!!

Thiru VT
  • 831
  • 2
  • 8
  • 24
  • 1
    But there would be problem of memory problem for that, instead you must select algorithm such a way that it would use minimum amount of memory – Bhavik Ambani May 23 '12 at 13:02
0

You can encrypt the number by changing its base from decimal to Binary,Octal,Hexa or your own base.

Original Number: 12345 ( in decimal )

Result after Encryption:

  • Binary : 11000000111001
  • Octal : 30071
  • Hexa : 3039
Lucifer
  • 29,392
  • 25
  • 90
  • 143