public class TripleDESCrytor extends Object implements Cryptor
Constructor and Description |
---|
TripleDESCrytor()
default constructor
|
Modifier and Type | Method and Description |
---|---|
String |
decrypt(String str)
decrypts the string
|
String |
encrypt(String clear)
Encrypt the string, if unable to encrypt, return null
|
static String |
GEN()
generates a new key
|
String |
newKey() |
public String encrypt(String clear) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException
Cryptor
encrypt
in interface Cryptor
NoSuchPaddingException
NoSuchAlgorithmException
InvalidAlgorithmParameterException
InvalidKeyException
IllegalBlockSizeException
BadPaddingException
public static String GEN()
public String decrypt(String str) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException
Cryptor
decrypt
in interface Cryptor
NoSuchPaddingException
NoSuchAlgorithmException
InvalidAlgorithmParameterException
InvalidKeyException
IllegalBlockSizeException
BadPaddingException
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.