전체 글 436

자바 AES 파일 암호화 예제

package test; import java.io.*; import java.security.Key; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; public class FileCoder { private static final String algorithm = "AES"; private static final String transformation = algorithm + "/ECB/PKCS5Padding"; private Key key; public FileCoder(Key key) { this.key = key; } /** * * 원본 파일을 암호화해서 대상 파일을 만든다. * * * @param source * 원본 파..