encryption/decryption help
I have very recently learned c# and was wondering on how to implement a way to do encryption/decryption. what im trying to do is use the Blowfish-compat algorithm with the key "mothking". this is for a program where the user inputs a txt file and it either decrypts or encrypts it (depending on the user's choice) with the Blowfish-compat algorithm and the mothking key.
7 Replies
The Bouncy Castle library contains implementations of a bunch of less commonly used algorithms like Blowfish. Using that library may fulfill your requirements. See https://www.bouncycastle.org/csharp/ for more info.
The Legion of the Bouncy Castle C# Cryptography APIs
Home of the Legion of the Bouncy Castle and their C# cryptography resources and open source code
Typical disclaimer: calling raw symmetric encryption primitives is an advanced scenario, make sure you are using them responsibly, etc. etc.
yes, but not blowfish-compat
they are different
Apologies, misread the question. IIRC the primary difference between blowfish and blowfish-compat is the endianness used to convert in-memory structures to/from integers. This suggests that you may be able to repurpose their implementation (https://github.com/bcgit/bc-csharp/blob/master/crypto/src/crypto/engines/BlowfishEngine.cs) and make any necessary minor tweaks to the endianness specific logic.
ok thx!
It has been a lifetime since I looked at blowfish so I'm going from memory here 🙂
alr ill look into it more
alr all i had to do was just make my own encrypter in addition to downloading a class of Blowfish encryption from github
works flawlessly 😎