Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am coding in PowerBuilder and actually have it working. My question is about the salt which is called the Initialization Vector by CNG.

I am taking the password which can be any length and generating a SHA-256 hash. I am using the hash as the Secret Key and the Initialization Vector. I then call BCryptGenerateSymmetricKey passing the 256-bit Secret Key and then call BCryptEncrypt passing the same as the Initialization Vector.

There aren't very many good examples that I can find. My main concern is that if a PowerBuilder app had to exchange encrypted data with an app developed in a different language, it isn't going to work unless the key and salt are the same.

Any tips on how encryption is done in other languages would be appreciated.

What I have tried:

See problem description, I pass hashed password as Secret Key and IV.
Posted
Updated 30-Dec-16 9:10am
v2
Comments
Richard MacCutchan 31-Dec-16 3:48am    
You are correct, the key and salt must be the same.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900