peass-ng/PEASS-ng · error · ArgumentException

cipher required with a block size of 16.

Error message

cipher required with a block size of 16.

What it means

A constructor guard in GcmBlockCipher: GCM's GHASH multiplication is defined over 128-bit blocks, so the wrapped IBlockCipher must report a block size of exactly 16 bytes. It fires when the cipher passed in (e.g. a 64-bit block cipher like Blowfish or a stream cipher adapter) is incompatible with GCM.

Source

Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/crypto/modes/GcmBlockCipher.cs:55

        private int bufOff;
        private ulong totalLength;
        private byte[] atBlock;
        private int atBlockPos;
        private ulong atLength;
        private ulong atLengthPre;

        public GcmBlockCipher(
            IBlockCipher c)
            : this(c, null)
        {
        }

        public GcmBlockCipher(
            IBlockCipher c,
            IGcmMultiplier m)
        {
            if (c.GetBlockSize() != BlockSize)
                throw new ArgumentException("cipher required with a block size of " + BlockSize + ".");

            if (m == null)
            {
                m = new Tables4kGcmMultiplier();
            }

            this.cipher = c;
            this.multiplier = m;
        }

        public virtual string AlgorithmName
        {
            get { return cipher.AlgorithmName + "/GCM"; }
        }

        public IBlockCipher GetUnderlyingCipher()
        {
            return cipher;

View on GitHub (pinned to 53fb989abc)

Solutions

  1. Use a 128-bit block cipher such as AES (AesEngine/AesFastEngine) or Camellia/Seed with GcmBlockCipher
  2. For non-16-byte-block ciphers choose a mode that supports them (e.g. CFB/CTR) instead of GCM
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/crypto/modes/GcmBlockCipher.cs:55 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of peass-ng/PEASS-ng@53fb989abc (2026-09-02). Data as JSON: /api/errors/765984f10e8cef77. Report an issue: GitHub.