public static uint DecryptUInt32( this ICipher cipher, byte[] encrypted) { if (cipher == null) { throw new ArgumentNullException(nameof(cipher)); } if (encrypted == null) { throw new ArgumentNullException(nameof(encrypted)); } var decrypted = cipher.Decrypt(encrypted); if (decrypted.Length < 4) { throw new ArgumentException(Resources.InvalidEncryptedValue); } return(FromByteArray.ToUInt32(decrypted)); }