Hashing using salt on android and iphone

1k views Asked by At

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.. :)

1

There are 1 answers

0
JesperB On

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