SHA-256: 1개의 글
[Spring] 비밀번호 암호화 SHA-256 / MD5
import java.security.MessageDigest; public class EncryptionUtils { public static String encryptSHA256(String s) { return encrypt(s, "SHA-256"); } public static String encryptMD5(String s) { return encrypt(s, "MD5"); } public static String encrypt(String s, String messageDigest) { try { MessageDigest md = MessageDigest.getInstance(messageDigest); byte[] passBytes = s.getBytes(); md.reset(); byte[..
Spring Framework/Spring security
2022. 5. 24. 15:17