public static NormalKey createFromSpec(String spec) {
        if (spec == null || !spec.contains(":")) {
            throw new IllegalArgumentException("Invalid spec format");
        }

        String[] parts = spec.split(":", 2);
        if (parts.length != 2) {
            throw new IllegalArgumentException("Invalid spec format");
        }

        String algorithmName = parts[0];
        String base64Key = parts[1];

        EncryptionAlgorithmPB algorithm;
        if (algorithmName.equalsIgnoreCase("AES_128")) {
            algorithm = EncryptionAlgorithmPB.AES_128;
        } else {
            throw new IllegalArgumentException("Unsupported algorithm: " + algorithmName);
        }

        byte[] plainKey;
        try {
            plainKey = Base64.getDecoder().decode(base64Key);
        } catch (IllegalArgumentException e) {
            throw new IllegalArgumentException("Invalid Base64 key", e);
        }

        if (plainKey.length != 16) {
            throw new IllegalArgumentException("Invalid key length " + plainKey.length * 8);
        }

        return new NormalKey(algorithm, plainKey, null);
    }
@Test
    public void testCreateFromSpec_InvalidBase64Key() {
        assertThrows(IllegalArgumentException.class, () -> {
            NormalKey.createFromSpec("AES_128:invalid_base64");
        });
    }