/// <summary> /// Decrypts the <paramref name="encrypted"/> to an array of <see cref="char"/> values. /// </summary> /// <param name="cipher">The cipher.</param> /// <param name="encrypted">The data to be decrypted.</param> /// <returns>The encrypted text.</returns> /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="cipher"/> is <see langword="null"/>.</exception> public static char[] DecryptCharArray( this ICipher cipher, byte[] encrypted) { if (cipher == null) { throw new ArgumentNullException(nameof(cipher)); } if (encrypted == null) { return(null); } return(FromByteArray.ToCharArray(cipher.Decrypt(encrypted))); }