Blowfish encryption.
Good afternoon, friends!
I came across another interesting work - the development of encryption using the Blowfish method. I haven't even heard of such encryption before, to be honest, so I ask for help from those who have worked with it.
Is there an algorithm in any programming language? It doesn't matter whether it's Delph, C#, js or php, the main thing is to understand the essence, because looking at this picture, it's not quite clear what and how to organize this algorithm.
1 answers
If you need to encrypt some data in a purely utilitarian way, it is easier to take a ready-made library and forget about how encryption happens. Otherwise, you risk getting bogged down in a lot of subtleties and eventually getting snake oil aka Snake Oil.
I assure you, this is not easy, cryptography is a whole science in which all the components must be precisely balanced, dosed and verified:
- The encryption method itself
- The hashing method.
- The algorithm key generation.
- The salting algorithm.
- Selecting the RNG.
- The algorithm for chaining blocks.
- , etc.
If at least one of these components is unknown to you, then you should either devote a few months of your life to studying cryptography or search for a lib for encryption. If we are talking about PHP, then start from here, if we are talking about C#, I recommend Googling Bouncy Castle.
Update
The above function crypt()
- this is not really an encryptor, but a hashing algorithm where Blowfish can be applied. Examples in PHP can be selected for example here or here