package jp.agentec.adf.security.cryptography;

import static org.junit.Assert.assertTrue;
import jp.agentec.adf.security.cryptography.AES;

import org.junit.Test;

public class AESTest {

	@Test
	public void testEncryptStringKey() {
		String password = "111111";
		String LoginPasswordAESKey = "1234567890123456";
		
		try {
			byte[] bt1 = AES.encrypt(password, AES.generateKey(LoginPasswordAESKey));
			byte[] bt2 = new byte[32];
			bt2 = AES.decrypt(bt1, AES.generateKey(LoginPasswordAESKey));
			String s2 = new String(bt2);
			System.out.println(s2);
			
			assertTrue(password.equals(s2));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
