Java Cryptography (Blowfish Encryption & Decryption Tutorial)

arie valiant
3 min readJun 30, 2019

Before i will show you tutorial about Blowfish Encryption & Decryption, let’s first understand about..

What is Encryption?

Encryption is a process which transforms the original information into an unrecognizable form. This new form of the message is entirely different from the original message. That’s why a hacker is not able to read the data as senders use an encryption algorithm. Encryption is usually done using key algorithms.

Encryption Process

Data is encrypted to make it safe from stealing. However, many known companies also encrypt data to keep their trade secret from their competitors.

What is Decryption?

Decryption is a process of converting encoded/encrypted data in a form that is readable and understood by a human or a computer. This method is performed by un-encrypting the text manually or by using keys used to encrypt the original data.

Decryption Process

And what is Blowfish cryptography method?

Blowfish is an encryption method that is a very strong weapon against hackers and cyber-criminals. It is used in a wide array of products, including some secure E-mail encryption tools, backup software, password management tools, and TiVo.

Blowfish was developed in 1993 by Bruce Schneier. It is a symmetric block cipher. What does that mean? Well, it is symmetric because the same key is used for both encryption and decryption; the key has to be kept secret from all others except the sender and receiver.

Symmetric encryption

A block cipher is basically a computer routine that takes any amount of plain text and converts it into coded text, or cipher-text. It performs this routine on chunks of text called blocks. And in order for the text to be decoded on the other side of transmission, the function must also generate a key to unlock the cipher-text.

Lets start!!

The first thing to do is, import the library according to the picture below:

so next make a “key” string for encryption & decryption process, make sure when you make this “key” no one knows 🤫 :

after you make a key, and then create encryption class process for make data encrypted:

and create decryption class process too:

Finally, you can test your encryption and decryption process:

Thank you..

--

--