필기4지선다보통 · 20점
6666.
다음 Java 코드에서 변수 secret에 값을 대입하는 줄에 있는 보안 약점은? (단, secret은 암호화 키를 저장하는 변수이다.)
1import javax.crypto.Cipher;2import javax.crypto.spec.SecretKeySpec;34public class Main {5public static byte[] encrypt(String text) throws Exception {6String secret = "q7Lm2025!aZ#k9Xp";7SecretKeySpec spec = new SecretKeySpec(secret.getBytes("UTF-8"), "AES");8Cipher cipher = Cipher.getInstance("AES");9cipher.init(Cipher.ENCRYPT_MODE, spec);10return cipher.doFinal(text.getBytes("UTF-8"));11}1213public static void main(String[] args) throws Exception {14System.out.println(encrypt("hello").length);15}16}
필기 4과목 · 정보시스템 구축관리★ 1회 출제 · 최근 2020년 3회