How to Decrypt a File That Was Encrypted in Blowfish
The Microsoft .NET framework provides you with the ability to encrypt and decrypt data using the Blowfish schema. Blowfish is an encryption scheme that protects private information such as financial data, medical records and Social Security information. Blowfish functions encrypt and decrypt files, so you can store information on the server or even the local computer. Use these functions to decrypt a Blowfish file used in the software.
Instructions
-
-
1
Create a variable that sets the Blowfish key. The key is the password to decrypt the file. The following code creates the Blowfish variable and sets it to contain a "mypass" password key:
Dim pwd As String.
pwd = "mypass" -
2
Set the key for the encryption object. The encryption object is a variable that contains all the information, such as the decryption password. The following code sets your Blowfish variable and the key for decryption:
Dim crypt As New Chilkat.Crypt2()
crypt.SetEncodedKey(pwd,"ascii") -
-
3
Decrypt your file. Blowfish decrypts the file and saves it to an unencrypted file. The following code decrypts a file named "encrypted.dat" and saves it to a file named "c.txt":
complete = crypt.CkDecryptFile("encrypted.dat","encrypted.txt")
The "complete" variable indicates that the decrypt was a success.
-
4
Send a message to the software user that the decryption completed successfully. The following code sends a message to the software user:
MsgBox ("File decrypted")
-
1
References
- Photo Credit padlocks image by Christopher Hall from Fotolia.com