Skip to content

Pasindu-Jayasundara/Cypher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cypher - Encryption & Decryption

Give the ability to encrypt and decrypt text. Encryption and decryption keys will be stored in the "secret.key" file

Features

  1. Encrypt text
  2. Decrypt text

Methods

  1. .encrypt(plainText);

  2. .decrypt(encryptedText);

How to Use

  1. Download the .jar file and add it to your project

  2. Import Library:

    import com.Cypher;
  3. Use Methods:

    i) .encrypt(plainText)

    This method is used to encrypt the given text

    try {
        String encrypt = Cypher.encrypt(plainText);
    } catch (Exception e) {
        e.printStackTrace();
    }

    ii) .decrypt(encryptedText)

    This method is used to decrypt the encrypted text

    try {
        String decrypt = Cypher.decrypt(encryptedText);
    } catch (Exception e) {
        e.printStackTrace();
    }

Outputs:

  1. .encrypt(plainText) -> encrypted text
  2. .decrypt(encryptedText) -> decrypted text

Example Code:

import com.Cypher;

public class B {

    public static void main(String[] args) {
        try {
            
            String decrypt = Cypher.decrypt("");
            String encrypt = Cypher.encrypt("");
            
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}