tobeyt23 Posted July 21, 2010 Share Posted July 21, 2010 Ok so I was asked to use this to encrypt my data: (first encoding) HashAlhorithm: SHA512 Passphrase: somepassphrase Saltvalue: somesaltvalue PasswordIterations: 42 Initvector: someinitvector (second encoding) HashAlhorithm: SHA256 Passphrase: somepassphrase2 Saltvalue: somesaltvalue2 PasswordIterations: 25 Initvector: someinitvector2 How would I do this??? Quote Link to comment Share on other sites More sharing options...
Mchl Posted July 21, 2010 Share Posted July 21, 2010 1. It's not encryption, it's hashing 2. hash Quote Link to comment Share on other sites More sharing options...
tobeyt23 Posted July 21, 2010 Author Share Posted July 21, 2010 This is what I have but said it was incorrect: hash('sha256', PASSPHRASE2 . SALT2. hash('sha512', PASSPHRASE1 . SALT1 . $data)); Quote Link to comment Share on other sites More sharing options...
tobeyt23 Posted July 21, 2010 Author Share Posted July 21, 2010 Okay I have this but still don't know how to use the InitVectorBytes: $iteration1 = '42'; $iteration2 = '25'; while(--$iteration1): $data = hash('sha512', $data . SALT1. PASSPHRASE1); endwhile; while(--$iteration2): $data = hash('sha256', $data . SALT2. PASSPHRASE2); endwhile; return $data; Quote Link to comment Share on other sites More sharing options...
Mchl Posted July 21, 2010 Share Posted July 21, 2010 May I ask what's the point of this? Hashing the hash 41 times doesn't make it any more hashed. Quote Link to comment Share on other sites More sharing options...
tobeyt23 Posted July 21, 2010 Author Share Posted July 21, 2010 that is the way i was asked to do it, not sure. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.