Code Room
Code reviewHardcr-g245
Subject Crypto misuseLevel Senior–Staff~30 minCommon in Security interviewsIndustries Software development

Question

Review this Java AES helper used to encrypt user records.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewjava
private static final byte[] IV = new byte[16]; // all zerosprivate static final SecretKeySpec KEY = loadKey(); public static byte[] encrypt(byte[] plaintext) throws Exception {    Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding");    c.init(Cipher.ENCRYPT_MODE, KEY, new IvParameterSpec(IV));    return c.doFinal(plaintext);}
Run or narrate your approach, then ask the coach.