3

I'm trying to encrypt a string the same way on a server in PHP as on an Objective-C on iOS. I've used PHP's crypt() function with the blowfish algorithm, but it takes two parameters: the string to encode and a salt. The Objective-C implementation I found: https://dl.dropboxusercontent.com/u/28430840/Blowfish-iOS-Source.zip which was at http://www.codeding.com/articles/blowfish-encryption-algorithm-for-iphone takes three different parameters: either EBC/CBC encoding, an initvector and a key -- how does this translate to the PHP salt?

I found the initial c library but I have no idea how to include it in my project -- when I compile it fails and complains about the x86.S file.

Thanks!!!

Nick C
  • 514
  • 3
  • 12
  • You are confusing two unrelated concepts. bcrypt is not an encryption algorithm; it is a key derivation function typically used for password hashing. – ntoskrnl Jul 27 '13 at 10:29

1 Answers1

0

I suppose you are looking at the wrong function. It's not crypt what you search, but mcrypt_encrypt.

This function takes an init vector, a key and an encoding parameter.

bwoebi
  • 23,637
  • 5
  • 58
  • 79