/// <summary> /// String info for the manager /// </summary> /// <returns>The string info that the manager contains</returns> public override string ToString() { var Builder = new StringBuilder(); Builder.AppendLineFormat("Asymmetric algorithms: {0}", AsymmetricAlgorithms.ToString(x => x.Name)); Builder.AppendLineFormat("Hashing algorithms: {0}", HasherAlgorithms.ToString(x => x.Name)); Builder.AppendLineFormat("Shift algorithms: {0}", ShiftAlgorithms.ToString(x => x.Name)); Builder.AppendLineFormat("Symmetric algorithms: {0}", SymmetricAlgorithms.ToString(x => x.Name)); return(Builder.ToString()); }
/// <summary> /// Encrypts the data based on the key /// </summary> /// <param name="Data">Data to encrypt</param> /// <param name="Key">Key to use</param> /// <returns>The encrypted data</returns> public byte[] Encrypt(byte[] Data, byte[] Key) { Contract.Requires <NullReferenceException>(ShiftAlgorithms != null, "ShiftAlgorithms"); var Found = ShiftAlgorithms.FirstOrDefault(); if (Found == null) { throw new ArgumentException("No shift based encryption algorithm found"); } return(Found.Encrypt(Data, Key)); }