public void GetHexStringFromBytes()
        {
            byte[] bytes = new byte[] { 0, 255 };
            string hex   = CryptographyUtility.GetHexStringFromBytes(bytes);

            Assert.AreEqual("00FF", hex);
        }
Beispiel #2
0
 private void SetKeyBox(byte[] key)
 {
     if (key.Length > 0)
     {
         keyBox.Text = CryptographyUtility.GetHexStringFromBytes(key);
     }
 }
        private void GenerateEntropy()
        {
            if (txtEntropy.TextLength == 0)
            {
                byte[] entropy = new byte[EntropySize];
                RandomNumberGenerator.Create().GetBytes(entropy);

                string hex = CryptographyUtility.GetHexStringFromBytes(entropy);
                txtEntropy.Text = hex;
            }
        }
 public void GetHexStringFromNullBytesThrows()
 {
     CryptographyUtility.GetHexStringFromBytes(null);
 }
 public void GetHexStringFromZeroBytesThrows()
 {
     CryptographyUtility.GetHexStringFromBytes(new byte[0]);
 }