I am encrypting a string using Setup Factory:
string Crypto.BlowfishEncryptString (
string Text,
string Key,
number LineLen = 0 )
Description:
Blowfish encrypts a string and returns a base64-encoded string containing the encrypted data.
Note: Base64 encoding is the process of encoding arbitrary data as plain ASCII text. One common use for this type of encoding is sending files through email. It is one of the techniques employed by the MIME standard to send data other than plain ASCII text.
I wrote this:
encryptedPass = Crypto.BlowfishEncryptString("password123", "uniqueKey", 0);
Which prints a base-64 string:
j5b+4W25ugGZxXJZ0HCFxw==
Now to decrypt the password, in C#:
Using the snippet available for .NET here.
string enKey = "uniqueKey";
string test = "j5b+4W25ugGZxXJZ0HCFxw==";
byte[] convertedByte = Encoding.Unicode.GetBytes(test);
string hex = BitConverter.ToString(convertedByte).Replace("-", string.Empty);
Blowfish algo = new Blowfish(enKey);
string decryptedTxt = algo.decryptString(hex);
But this returns null, I tried it without decoding the base-64 as well.
EDIT:
Tried decoding the base-64 string as well:
byte[] bytes = Convert.FromBase64String(test);
string hex = BitConverter.ToString(bytes).Replace("-", string.Empty);
Blowfish algo = new Blowfish(enKey);
string decryptedTxt = algo.decryptString(hex);