-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAES256CipherTest.java
More file actions
46 lines (34 loc) · 1.46 KB
/
Copy pathAES256CipherTest.java
File metadata and controls
46 lines (34 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package codingTest;
import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
public class AES256CipherTest {
public static void encDesTest() throws InvalidKeyException, UnsupportedEncodingException,
NoSuchAlgorithmException, NoSuchPaddingException,
InvalidAlgorithmParameterException, IllegalBlockSizeException,
BadPaddingException {
String id = "849384928928392";
String custrnmNo = "111111";
String custNm = "테스트";
AES256Cipher a256 = AES256Cipher.getInstance();
String enId = a256.AES_Encode(id);
String enYyyymmdd = a256.AES_Encode(custrnmNo);
String enCustNm = a256.AES_Encode(custNm);
String desId = a256.AES_Decode(enId);
String desYyyymmdd = a256.AES_Decode(enYyyymmdd);
String desCustNm = a256.AES_Decode(enCustNm);
System.out.println(enId);
System.out.println(enYyyymmdd);
System.out.println(enCustNm);
System.out.println(desId);
System.out.println(desYyyymmdd);
System.out.println(desCustNm);
}
public static void main(String args[]) throws InvalidKeyException, UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException {
encDesTest();
}
}