예제 #1
0
		public void test_0()
		{
			Skip32Cipher cipher = new Skip32Cipher("1234567890abcdef0123", Skip32CipherKeyFormat.HexString);

			int value0 = 0;
			int value1 = cipher.Encrypt(value0);
			int value2 = cipher.Decrypt(value1);

			// Ensure that the encryption is reversible
			Assert.AreEqual(value0, value2);

			// Ensure the encryption is not an identity function
			Assert.AreNotEqual(value0, value1);
		}
예제 #2
0
		public void invalid_base64_key_length()
		{
			string key = "abcde";
			Skip32Cipher cipher = new Skip32Cipher(key, Skip32CipherKeyFormat.Base64);
		}
예제 #3
0
		public void empty_base64_key()
		{
			string key = "";
			Skip32Cipher cipher = new Skip32Cipher(key, Skip32CipherKeyFormat.Base64);
		}
예제 #4
0
		public void incorrect_hex_key_length()
		{
			string key = "abc";
			Skip32Cipher cipher = new Skip32Cipher(key, Skip32CipherKeyFormat.HexString);
		}
예제 #5
0
		public void empty_hex_key()
		{
			string key = "";
			Skip32Cipher cipher = new Skip32Cipher(key, Skip32CipherKeyFormat.HexString);
		}
예제 #6
0
		public void null_base64_key()
		{
			string key = null;
			Skip32Cipher cipher = new Skip32Cipher(key, Skip32CipherKeyFormat.Base64);
		}
예제 #7
0
		public void null_hex_key()
		{
			string key = null;
			Skip32Cipher cipher = new Skip32Cipher(key, Skip32CipherKeyFormat.HexString);
		}
예제 #8
0
		public void incorrect_byte_array_key_length()
		{
			byte[] key = new byte[1];
			Skip32Cipher cipher = new Skip32Cipher(key);
		}
예제 #9
0
		public void null_byte_array_key()
		{
			byte[] key = null;
			Skip32Cipher cipher = new Skip32Cipher(key);
		}