Give the ability to encrypt and decrypt text. Encryption and decryption keys will be stored in the "secret.key" file
- Encrypt text
- Decrypt text
-
.encrypt(plainText);
-
.decrypt(encryptedText);
-
Download the .jar file and add it to your project
-
Import Library:
import com.Cypher;
-
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(); }
- .encrypt(plainText) -> encrypted text
- .decrypt(encryptedText) -> decrypted text
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();
}
}
}