public String decrypt ( String encrytedText , String key ) { Objects . requireNonNull ( encrytedText , Required . ENCRYPTED_TEXT . toString ( ) ) ; Objects . requireNonNull ( key , Required . KEY . toString ( ) ) ; CipherParameters cipherParameters = new ParametersWithRandom ( new KeyParameter ( getSizedSecret ( key ) . getBytes ( StandardCharsets . UTF_8 ) ) ) ; this . paddedBufferedBlockCipher . init ( false , cipherParameters ) ; return new String ( cipherData ( base64Decoder . decode ( encrytedText ) ) , StandardCharsets . UTF_8 ) ; }
Decrypts an given encrypted text using the given key