1

I am developing an app on both android and iphone which requires encryption of some data.

I want to know is there any way to encrypt data producing same hash on both platform. I have common salt, just wanted to have same encrypted data output from digest as my server is same for both platform.

I am bit new to iphone so my question would be naive please bear with it.. :)

nishi
  • 1,245
  • 3
  • 13
  • 22

1 Answers1

1

You can use a standard hashing algoritm like SHA1, and just append your salt to the original string.

Please note the difference between encrypt and hash:

  • Encrypting scrambles data in such a way that it is possible to recreate the original data using some kind of key (decrypting).
  • Hashing doesn't provide a way to decrypt, because several different inputs may produce the same hash
JesperB
  • 4,625
  • 1
  • 36
  • 40