All Known Implementing Classes:
AESGCMNoPadding

public interface Cipher
Cipher interface.
Since:
4.0.1
  • Method Summary

    Modifier and Type
    Method
    Description
    decrypt(String encryptedText, String password)
    Decrypts the encrypted text with password and returns clear text result.
    encrypt(String clearText, String password)
    Encrypts the clear text data with password and returns result.
  • Method Details

    • encrypt

      String encrypt(String clearText, String password) throws CipherException
      Encrypts the clear text data with password and returns result. No argument is allowed to be null.
      Throws:
      CipherException - if encryption failed (is unexpected to happen, as it would mean that Java Runtime lacks some Crypto elements).
    • decrypt

      String decrypt(String encryptedText, String password) throws CipherException
      Decrypts the encrypted text with password and returns clear text result. No argument is allowed to be null.
      Throws:
      CipherException - if decryption failed. It may happen as with encrypt(String, String) due Java Runtime lacking some Crypto elements (less likely). Most likely decrypt will fail due wrong provided password or maybe corrupted encrypted text.