private static CryptographicKey getKey(SymmetricKeyAlgorithmProvider Algorithm) { IBuffer keymaterial = CryptographicBuffer.CreateFromByteArray(ByteUtils.getBytes(KEY.Substring(0, SIZE_IV))); CryptographicKey _key = null; try { _key = Algorithm.CreateSymmetricKey(keymaterial); } catch (ArgumentException ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } return _key; }
public Encryption(string key, string iv) { this.alg = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbc); this.key = key; this.iv = iv; }
public SymmetricKeyEncryptor (SymmetricKeyAlgorithmProvider algorithm, CryptographicKey key, IBuffer iv) { this.algorithm = algorithm; this.key = key; this.iv = iv; }
/// <summary> /// Initializes a new instance of the <see cref="SymmetricKeyAlgorithmProvider"/> class. /// </summary> /// <param name="algorithm">The algorithm.</param> public SymmetricKeyAlgorithmProvider(SymmetricAlgorithm algorithm) { this.algorithm = algorithm; this.platform = Platform.SymmetricKeyAlgorithmProvider.OpenAlgorithm(GetAlgorithmName(algorithm)); }
public UAPSymmetricKeyAlgorithmProvider(SymmetricKeyAlgorithmProvider provider) { this.provider = provider; }