https://mvnrepository.com/artifact/commons-codec/commons-codec 위 링크로 commons-code 1.10 pom.xml에추가 public class Aes128 { /** * 암호화 * * @param input * @param key * @return */ public static String encrypt(String input, String key) { byte[] crypted = null; try { SecretKeySpec skey = new SecretKeySpec(key.getBytes(), "AES"); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); cipher.init(Ciph..
import java.security.*;public class SHA256Util { public String encryptSHA256(String str){ String sha = ""; try{ MessageDigest sh = MessageDigest.getInstance("SHA-256"); sh.update(str.getBytes()); byte byteData[] = sh.digest(); StringBuffer sb = new StringBuffer(); for(int i = 0 ; i < byteData.length ; i++){ sb.append(Integer.toString((byteData[i]&0xff) + 0x100, 16).substring(1)); } sha = sb.toSt..