C
C#•11mo ago
Turtles

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
GrabYourPitchforks
GrabYourPitchforks•11mo ago
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
GrabYourPitchforks
GrabYourPitchforks•11mo ago
Typical disclaimer: calling raw symmetric encryption primitives is an advanced scenario, make sure you are using them responsibly, etc. etc.
Turtles
TurtlesOP•11mo ago
yes, but not blowfish-compat they are different
GrabYourPitchforks
GrabYourPitchforks•11mo ago
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.
Turtles
TurtlesOP•11mo ago
ok thx!
GrabYourPitchforks
GrabYourPitchforks•11mo ago
It has been a lifetime since I looked at blowfish so I'm going from memory here 🙂
Turtles
TurtlesOP•11mo ago
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 😎
Want results from more Discord servers?
Add your server