diff --git a/native/src/main/java/net/md_5/bungee/NativeCipher.java b/native/src/main/java/net/md_5/bungee/NativeCipher.java index 10e15bf8..6d4c42c3 100644 --- a/native/src/main/java/net/md_5/bungee/NativeCipher.java +++ b/native/src/main/java/net/md_5/bungee/NativeCipher.java @@ -59,6 +59,7 @@ public class NativeCipher implements BungeeCipher @Override public void init(boolean forEncryption, SecretKey key) throws GeneralSecurityException { + Preconditions.checkArgument( key.getEncoded().length == 16, "Invalid key size" ); if ( pointer != 0 ) { nativeCipher.free( pointer );