private byte[] EncryptAesCbcPkcs7(Span <byte> key, byte[] plaintext)
        {
            var iv = new Span <byte>(new byte[IvLength]);

            _randomNumberGenerator.Fill(iv);

            using var encryptor = _aesCryptoProvider.CreateEncryptor(key.ToArray(), iv.ToArray());
            using var ms        = new MemoryStream();
            using var cs        = new CryptoStream(ms, encryptor, CryptoStreamMode.Write);
            using var sw        = new BinaryWriter(cs);
            sw.Write(plaintext);
            cs.FlushFinalBlock();

            return(Concat(iv.ToArray(), ms.ToArray()));
        }