Repository: moserware/TLS-1.0-Analyzer Branch: master Commit: 46dfd4eb073b Files: 34 Total size: 330.7 KB Directory structure: gitextract_6196v8ry/ ├── Arc4.cs ├── BigIntegerUtilities.cs ├── ByteUtilities.cs ├── FirefoxSslDebugFileUtilities.cs ├── Hasher.cs ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── Mono/ │ ├── BigInteger.cs │ ├── ConfidenceFactor.cs │ ├── NextPrimeFinder.cs │ ├── PrimalityTests.cs │ ├── PrimeGeneratorBase.cs │ └── SequentialSearchPrimeGeneratorBase.cs ├── Prf10.cs ├── Program.cs ├── Properties/ │ ├── AssemblyInfo.cs │ ├── Settings.Designer.cs │ └── Settings.settings ├── RsaUtilities.cs ├── Settings.cs ├── TlsAnalyzer.csproj ├── TlsAnalyzer.sln ├── UnitTests/ │ ├── Arc4Tests.cs │ ├── BigIntegerTests.cs │ ├── ByteUtilitiesTest.cs │ ├── FirefoxSslDebugFileUtilitiesTest.cs │ ├── Prf10Tests.cs │ ├── Properties/ │ │ └── AssemblyInfo.cs │ ├── UnitTests.csproj │ ├── UnitTests.csproj.user │ └── WiresharkClipboardUtilitiesTests.cs ├── WiresharkClipboardUtilities.cs └── app.config ================================================ FILE CONTENTS ================================================ ================================================ FILE: Arc4.cs ================================================ namespace Moserware.TlsAnalyzer { /// /// "Alleged RC4" Implementation /// /// /// See pages 397-398 of "Applied Cryptography, 2nd Edition" by Bruce Schneier. /// The "alleged" part is for historical reasons (and that's how Firefox's NSS library refers to it). /// public class Arc4 { private byte[] _SubstitionBox = new byte[256]; private byte[] _KeyingMaterial = new byte[256]; private int _CounterI; private int _CounterJ; /// /// Initializes the algorithm with the . /// /// The key to use for encryption/decryption. public Arc4(byte[] key) { // "Fill it linearly" for (int i = 0; i < 256; i++) { _SubstitionBox[i] = (byte)i; } // "fill another 256-byte array with the key, // repeating the key as necessary to fill the entire array" for (int i = 0; i < 256; i++) { _KeyingMaterial[i] = key[i % key.Length]; } int j = 0; for (int i = 0; i < 256; i++) { j = (j + _SubstitionBox[i] + _KeyingMaterial[i]) % 256; // Swap S[i] and S[j] Swap(ref _SubstitionBox[i], ref _SubstitionBox[j]); } // "And that's it." } private static void Swap(ref byte b1, ref byte b2) { byte temp = b1; b1 = b2; b2 = temp; } /// /// Encrypts the . /// /// The plaintext bytes that will be encrypted public byte[] Encrypt(byte[] input) { byte[] encryptedValue = new byte[input.Length]; for (int i = 0; i < input.Length; i++) { encryptedValue[i] = (byte) (GetNextByte() ^ input[i]); } return encryptedValue; } private byte GetNextByte() { _CounterI = (_CounterI + 1) % 256; _CounterJ = (_CounterJ + _SubstitionBox[_CounterI]) % 256; Swap(ref _SubstitionBox[_CounterI], ref _SubstitionBox[_CounterJ]); byte t = (byte) ((_SubstitionBox[_CounterI] + _SubstitionBox[_CounterJ]) % 256); return _SubstitionBox[t]; } } } ================================================ FILE: BigIntegerUtilities.cs ================================================ using System.Text; using Mono.Math; namespace Moserware.TlsAnalyzer { /// /// Utilities for s. /// public static class BigIntegerUtilities { /// /// Converts a to a base-10 representation that's in groups of 10. /// /// The integer to display. /// A base-10 representation of with digit groups of 10 digits. public static string ToDisplayString(this BigInteger bigInteger) { var sb = new StringBuilder(); string base10 = bigInteger.ToString(); for (int i = 0; i < base10.Length; i++) { if ((i % 10 == 0) && (i > 0)) { sb.Append(" "); } sb.Append(base10[i]); } return sb.ToString(); } } } ================================================ FILE: ByteUtilities.cs ================================================ using System; using System.Globalization; using System.IO; using System.Text; namespace Moserware.TlsAnalyzer { /// /// Utilities to help with s. /// public static class ByteUtilities { /// /// Performs xor . /// /// The first byte array. /// The second byte array. /// xor public static byte[] Xor(this byte[] a, byte[] b) { if (a.Length > b.Length) { throw new ArgumentException("'a' must be smaller than or equal to 'b'"); } byte[] result = new byte[b.Length]; for (int i = 0; i < a.Length; i++) { result[i] = (byte)(a[i] ^ b[i]); } for (int i = a.Length; i < b.Length; i++) { result[i] = b[i]; } return result; } /// /// Concatenates byte arrays into a single byte array. /// /// An array containing all the byte arrays to combine. /// A combined array of all of the individual arrays in . public static byte[] ConcatBytes(params byte[][] byteArrays) { using(var ms = new MemoryStream()) { foreach(byte[] currentArray in byteArrays) { ms.Write(currentArray, 0, currentArray.Length); } return ms.ToArray(); } } /// /// Determines if two byte arrays are equivalent. /// /// The first byte array. /// The second byte array. /// if the byte arrays are equal; otherwise, . public static bool AreEqual(byte[] a, byte[] b) { if(a.Length != b.Length) { return false; } for(int i = 0; i < a.Length; i++) { if(a[i] != b[i]) { return false; } } return true; } /// /// Formats the bytes for display into single byte segments. /// /// Array to convert to a display string. /// Formatted display byte string. public static string ToDisplayByteString(this byte[] bytes) { return ToDisplayByteString(bytes, 1); } /// /// Gets the ASCII byte represetnation of . /// /// The string to get the ASCII byte representation of. /// The ASCII byte representation of . public static byte[] ToAsciiBytes(this string s) { return Encoding.ASCII.GetBytes(s); } /// /// Formats the bytes for display into byte segments. /// /// Array to convert to a display string. /// Formatted display byte string. public static string ToDisplayByteString(this byte[] bytes, int byteGroupSize) { int remainderBytes = (bytes.Length % byteGroupSize); int extraBytesNeeded = (remainderBytes == 0) ? 0 : (byteGroupSize - remainderBytes); StringBuilder sb = new StringBuilder(); int totalBytes = bytes.Length + extraBytesNeeded; for (int i = 0; i < totalBytes; i++) { if (((i % byteGroupSize) == 0) && (i > 0)) { // Add a space between the byte groups sb.Append(" "); } if (i < extraBytesNeeded) { // Add pad bytes sb.Append("00"); } else { byte currentByte = bytes[i - extraBytesNeeded]; sb.Append(currentByte.ToString("X2", CultureInfo.InvariantCulture)); } } return sb.ToString(); } /// /// Return a length subset of starting at . /// /// The byte array to take a subset of. /// The zero-based starting index of subset. /// The total bytes to have in the subset. /// A length subset of starting at . public static byte[] SubBytes(this byte[] bytes, int startIndex, int length) { using (var ms = new MemoryStream()) { ms.Write(bytes, startIndex, length); return ms.ToArray(); } } /// /// Return a subset of starting at . /// /// The byte array to take a subset of. /// The zero-based starting index of subset. /// A subset of starting at . public static byte[] SubBytes(this byte[] bytes, int startIndex) { return SubBytes(bytes, startIndex, bytes.Length - startIndex); } } } ================================================ FILE: FirefoxSslDebugFileUtilities.cs ================================================ using System; using System.IO; namespace Moserware.TlsAnalyzer { /// /// Utilities to work with Firefox's debug files. /// public static class FirefoxSslDebugFileUtilities { /// /// Helper function for things dumped to SSLDEBUGFILE with appropriate SSLTRACE levels. /// /// Raw input that has the pre-master secret. /// The pre-master secret key bytes. public static byte[] GetPremasterSecretKey(string input) { // Looks like // 5140: SSL[75821480]: Pre-Master Secret [Len: 48] // 03 01 97 01 9e aa 3c 3c e1 ef 7f 39 5d be 88 1e ......<<...9]... // 60 51 e7 f5 94 db fd 62 b2 b5 26 be b5 3d 7c 16 `Q.....b..&..=|. // 4d ff 79 73 8e cb c8 aa 9c 70 f2 5d 29 91 72 50 M.ys.....p.]).rP using (var sr = new StringReader(input)) { bool foundHeader = false; while (sr.Peek() >= 0) { string currentLine = sr.ReadLine().Trim(); if (!foundHeader) { if (!currentLine.Contains("Pre-Master Secret")) { continue; } foundHeader = true; break; } } if (!foundHeader) { throw new InvalidDataException(); } // reading in secret bytes using (var ms = new MemoryStream()) { for (int ixCurrentLine = 0; ixCurrentLine < 3; ixCurrentLine++) { string currentLine = sr.ReadLine().Trim(); for (int ixCurrentByte = 0; ixCurrentByte < 16; ixCurrentByte++) { string byteText = currentLine.Substring(3 * ixCurrentByte, 2); ms.WriteByte(Convert.ToByte(byteText, 16)); } } return ms.ToArray(); } } } } } ================================================ FILE: Hasher.cs ================================================ using System; using System.Net; using System.Security.Cryptography; namespace Moserware.TlsAnalyzer { /// /// Provides some simple wrappers around hash functions. /// public static class Hasher { private static readonly SHA1Managed _SHA1 = new SHA1Managed(); private static readonly MD5 _MD5 = new MD5CryptoServiceProvider(); private static readonly HMACMD5 _HmacMd5 = new HMACMD5(); private static readonly HMACSHA1 _HmacSha1 = new HMACSHA1(); /// /// Computes the SHA-1 hash. /// /// The bytes to compute the hash of. /// The 20 byte SHA-1 digest of . public static byte[] ComputeSHA1Hash(byte[] inputBytes) { return _SHA1.ComputeHash(inputBytes); } /// /// Computes the keyed HMAC version of the SHA-1 hash. /// /// The key to use for the HMAC operation. /// The bytes to compute the hash of. /// The 20 byte HMAC SHA-1 digest of using . public static byte[] ComputeSHA1Hmac(byte[] key, byte[] inputBytes) { _HmacSha1.Key = key; return _HmacSha1.ComputeHash(inputBytes); } /// /// Computes the MD5 hash. /// /// The bytes to compute the hash of. /// The 16 byte MD5 digest of . public static byte[] ComputeMD5(byte[] inputBytes) { return _MD5.ComputeHash(inputBytes); } /// /// Computes the keyed HMAC version of the MD5 hash. /// /// The key to use for the HMAC operation. /// The bytes to compute the hash of. /// The 16 byte HMAC MD5 digest of using . public static byte[] ComputeMD5Hmac(byte[] key, byte[] data) { _HmacMd5.Key = key; return _HmacMd5.ComputeHash(data); } // HMAC_hash(MAC_write_secret, seq_num + TLSCompressed.type + // TLSCompressed.version + TLSCompressed.length + // TLSCompressed.fragment)); /// /// Computes the TLS 1.0 MD5 HMAC for a record. /// /// The secret to use for the HMAC calculation. /// The TLS record content type. /// The sequence number of the fragment. /// The data sent. /// The 16 byte HMAC hash. public static byte[] ComputeTlsMD5Hmac(byte[] secret, byte contentType, long sequenceNumber, byte[] fragment) { _HmacMd5.Key = secret; return _HmacMd5.ComputeHash( ByteUtilities.ConcatBytes( BitConverter.GetBytes(IPAddress.HostToNetworkOrder(sequenceNumber)), new [] { contentType }, new byte[] {3, 1}, // version BitConverter.GetBytes(IPAddress.HostToNetworkOrder((short) fragment.Length)), fragment)); } } } ================================================ FILE: MainForm.Designer.cs ================================================ namespace Moserware.TlsAnalyzer { partial class MainForm { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.label1 = new System.Windows.Forms.Label(); this.btnGo = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.txtServerChangeCipherSpec = new System.Windows.Forms.TextBox(); this.label10 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); this.txtDecryptedClientKeyExchange = new System.Windows.Forms.TextBox(); this.label13 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label(); this.tabControl = new System.Windows.Forms.TabControl(); this.tabHandshakeMessages = new System.Windows.Forms.TabPage(); this.groupBox8 = new System.Windows.Forms.GroupBox(); this.txtClientEncryptedFinishedMessage = new System.Windows.Forms.TextBox(); this.txtClientHello = new System.Windows.Forms.TextBox(); this.txtServerHello = new System.Windows.Forms.TextBox(); this.txtClientKeyExchange = new System.Windows.Forms.TextBox(); this.txtServerHelloCertificate = new System.Windows.Forms.TextBox(); this.txtServerEncryptedHandshakeMessage = new System.Windows.Forms.TextBox(); this.txtServerHelloDone = new System.Windows.Forms.TextBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox10 = new System.Windows.Forms.GroupBox(); this.txtServerFinishedHmacMd5 = new System.Windows.Forms.TextBox(); this.label63 = new System.Windows.Forms.Label(); this.label64 = new System.Windows.Forms.Label(); this.txtServerFinishedVerifyData = new System.Windows.Forms.TextBox(); this.txtServerFinishedHeader = new System.Windows.Forms.TextBox(); this.label65 = new System.Windows.Forms.Label(); this.groupBox9 = new System.Windows.Forms.GroupBox(); this.txtClientFinishedHmacMd5 = new System.Windows.Forms.TextBox(); this.label62 = new System.Windows.Forms.Label(); this.label51 = new System.Windows.Forms.Label(); this.txtClientFinishedVerifyData = new System.Windows.Forms.TextBox(); this.txtClientFinishedHeader = new System.Windows.Forms.TextBox(); this.label50 = new System.Windows.Forms.Label(); this.tabDebuggingInput = new System.Windows.Forms.TabPage(); this.txtPremasterSecret = new System.Windows.Forms.TextBox(); this.tabCertificatesInput = new System.Windows.Forms.TabPage(); this.btnCalculateCertificateInformation = new System.Windows.Forms.Button(); this.groupBox15 = new System.Windows.Forms.GroupBox(); this.label76 = new System.Windows.Forms.Label(); this.txtVerisignClass3PrimaryCertificationAuthorityModulus = new System.Windows.Forms.TextBox(); this.txtVerisignClass3PrimaryCertificationAuthoritySignatureValue = new System.Windows.Forms.TextBox(); this.label78 = new System.Windows.Forms.Label(); this.label80 = new System.Windows.Forms.Label(); this.txtVerisignClass3PrimaryCertificationAuthorityPublicExponent = new System.Windows.Forms.TextBox(); this.groupBox14 = new System.Windows.Forms.GroupBox(); this.label75 = new System.Windows.Forms.Label(); this.txtVersignClass3SecureServerSignedCertificate = new System.Windows.Forms.TextBox(); this.txtVerisignClass3SecureServerModulus = new System.Windows.Forms.TextBox(); this.txtVerisignClass3SecureServerSignatureValue = new System.Windows.Forms.TextBox(); this.label72 = new System.Windows.Forms.Label(); this.label74 = new System.Windows.Forms.Label(); this.label73 = new System.Windows.Forms.Label(); this.txtVerisignClass3SecureServerPublicExponent = new System.Windows.Forms.TextBox(); this.groupBox13 = new System.Windows.Forms.GroupBox(); this.txtAmazonModulus = new System.Windows.Forms.TextBox(); this.label69 = new System.Windows.Forms.Label(); this.label68 = new System.Windows.Forms.Label(); this.txtAmazonPublicExponent = new System.Windows.Forms.TextBox(); this.label66 = new System.Windows.Forms.Label(); this.txtAmazonSignatureValue = new System.Windows.Forms.TextBox(); this.label67 = new System.Windows.Forms.Label(); this.txtAmazonSignedCertificate = new System.Windows.Forms.TextBox(); this.tabCertificatesOutput = new System.Windows.Forms.TabPage(); this.groupBox18 = new System.Windows.Forms.GroupBox(); this.txtVerisignClass3PrimaryCertificationAuthorityHashValue = new System.Windows.Forms.TextBox(); this.label87 = new System.Windows.Forms.Label(); this.label77 = new System.Windows.Forms.Label(); this.txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature = new System.Windows.Forms.TextBox(); this.txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId = new System.Windows.Forms.TextBox(); this.label88 = new System.Windows.Forms.Label(); this.txtVerisignClass3PrimaryCertificationAuthorityModulusBase10 = new System.Windows.Forms.TextBox(); this.label86 = new System.Windows.Forms.Label(); this.groupBox17 = new System.Windows.Forms.GroupBox(); this.txtVerisignClass3SecureServerHashValue = new System.Windows.Forms.TextBox(); this.label83 = new System.Windows.Forms.Label(); this.txtVerisignClass3SecureServerHashAlgorithmId = new System.Windows.Forms.TextBox(); this.txtVerisignClass3SecureServerModulusBase10 = new System.Windows.Forms.TextBox(); this.label71 = new System.Windows.Forms.Label(); this.label85 = new System.Windows.Forms.Label(); this.label84 = new System.Windows.Forms.Label(); this.txtVerisignClass3SecureServerDecryptedSignature = new System.Windows.Forms.TextBox(); this.groupBox16 = new System.Windows.Forms.GroupBox(); this.txtAmazonHashValue = new System.Windows.Forms.TextBox(); this.txtAmazonHashAlgorithmId = new System.Windows.Forms.TextBox(); this.label82 = new System.Windows.Forms.Label(); this.label79 = new System.Windows.Forms.Label(); this.txtAmazonDecryptedSignature = new System.Windows.Forms.TextBox(); this.label81 = new System.Windows.Forms.Label(); this.label70 = new System.Windows.Forms.Label(); this.txtAmazonModulusBase10 = new System.Windows.Forms.TextBox(); this.tabKeyInput = new System.Windows.Forms.TabPage(); this.txtServerFinishedLabel = new System.Windows.Forms.TextBox(); this.label61 = new System.Windows.Forms.Label(); this.txtClientFinishedLabel = new System.Windows.Forms.TextBox(); this.label60 = new System.Windows.Forms.Label(); this.txtSha1HandshakeMessages = new System.Windows.Forms.TextBox(); this.txtMd5HandshakeMessages = new System.Windows.Forms.TextBox(); this.label59 = new System.Windows.Forms.Label(); this.label58 = new System.Windows.Forms.Label(); this.label57 = new System.Windows.Forms.Label(); this.txtHandshakeMessages = new System.Windows.Forms.TextBox(); this.txtKeyExpansionLabel = new System.Windows.Forms.TextBox(); this.label56 = new System.Windows.Forms.Label(); this.label54 = new System.Windows.Forms.Label(); this.label53 = new System.Windows.Forms.Label(); this.label52 = new System.Windows.Forms.Label(); this.txtMasterSecretLabel = new System.Windows.Forms.TextBox(); this.txtServerRandomBytes = new System.Windows.Forms.TextBox(); this.txtClientRandomBytes = new System.Windows.Forms.TextBox(); this.tabDerivedKeys = new System.Windows.Forms.TabPage(); this.txtServerIV = new System.Windows.Forms.TextBox(); this.txtClientIV = new System.Windows.Forms.TextBox(); this.txtServerWriteKey = new System.Windows.Forms.TextBox(); this.txtClientWriteKey = new System.Windows.Forms.TextBox(); this.txtServerWriteMacKey = new System.Windows.Forms.TextBox(); this.txtClientWriteMacKey = new System.Windows.Forms.TextBox(); this.txtMasterSecret = new System.Windows.Forms.TextBox(); this.label55 = new System.Windows.Forms.Label(); this.label24 = new System.Windows.Forms.Label(); this.label23 = new System.Windows.Forms.Label(); this.label18 = new System.Windows.Forms.Label(); this.label17 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.tabAppDataInput = new System.Windows.Forms.TabPage(); this.txtServerApplicationDataInput = new System.Windows.Forms.TextBox(); this.txtClientApplicationDataInput = new System.Windows.Forms.TextBox(); this.tabDecryptedAppData = new System.Windows.Forms.TabPage(); this.groupBox12 = new System.Windows.Forms.GroupBox(); this.txtServerApplicationDataHmac = new System.Windows.Forms.TextBox(); this.txtDecryptedServerApplicationData = new System.Windows.Forms.TextBox(); this.label21 = new System.Windows.Forms.Label(); this.label22 = new System.Windows.Forms.Label(); this.groupBox11 = new System.Windows.Forms.GroupBox(); this.txtClientApplicationDataHmac = new System.Windows.Forms.TextBox(); this.txtDecryptedClientApplicationData = new System.Windows.Forms.TextBox(); this.label19 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label(); this.tabHmac = new System.Windows.Forms.TabPage(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.groupBox7 = new System.Windows.Forms.GroupBox(); this.txtHmacSha1Result = new System.Windows.Forms.TextBox(); this.label44 = new System.Windows.Forms.Label(); this.txtHmacSha1InnerHash = new System.Windows.Forms.TextBox(); this.label45 = new System.Windows.Forms.Label(); this.txtHmacSha1KeyXorIpad = new System.Windows.Forms.TextBox(); this.label46 = new System.Windows.Forms.Label(); this.txtHmacSha1IpadBytes = new System.Windows.Forms.TextBox(); this.label47 = new System.Windows.Forms.Label(); this.txtHmacSha1KeyXorOpad = new System.Windows.Forms.TextBox(); this.label48 = new System.Windows.Forms.Label(); this.txtHmacSha1Opad = new System.Windows.Forms.TextBox(); this.label49 = new System.Windows.Forms.Label(); this.txtHmacDataAsciiBytes = new System.Windows.Forms.TextBox(); this.label37 = new System.Windows.Forms.Label(); this.txtHmacKeyAsciiBytes = new System.Windows.Forms.TextBox(); this.label36 = new System.Windows.Forms.Label(); this.groupBox6 = new System.Windows.Forms.GroupBox(); this.txtHmacMd5Result = new System.Windows.Forms.TextBox(); this.label43 = new System.Windows.Forms.Label(); this.txtHmacMd5InnerHash = new System.Windows.Forms.TextBox(); this.label42 = new System.Windows.Forms.Label(); this.txtHmacMd5KeyXorIpad = new System.Windows.Forms.TextBox(); this.label41 = new System.Windows.Forms.Label(); this.txtHmacMd5IpadBytes = new System.Windows.Forms.TextBox(); this.label40 = new System.Windows.Forms.Label(); this.txtHmacMd5KeyXorOpad = new System.Windows.Forms.TextBox(); this.label39 = new System.Windows.Forms.Label(); this.txtHmacMd5Opad = new System.Windows.Forms.TextBox(); this.label38 = new System.Windows.Forms.Label(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.btnGenerateHmac = new System.Windows.Forms.Button(); this.label34 = new System.Windows.Forms.Label(); this.txtHmacDataString = new System.Windows.Forms.TextBox(); this.label35 = new System.Windows.Forms.Label(); this.txtHmacKeyString = new System.Windows.Forms.TextBox(); this.label33 = new System.Windows.Forms.Label(); this.tabPrf = new System.Windows.Forms.TabPage(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.label32 = new System.Windows.Forms.Label(); this.txtPrfAsciiLabelBytes = new System.Windows.Forms.TextBox(); this.label31 = new System.Windows.Forms.Label(); this.txtPrfMD5Output = new System.Windows.Forms.TextBox(); this.label30 = new System.Windows.Forms.Label(); this.txtPrfOutput = new System.Windows.Forms.TextBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.txtPrfSeedBytes = new System.Windows.Forms.TextBox(); this.label29 = new System.Windows.Forms.Label(); this.btnPrfGenerate = new System.Windows.Forms.Button(); this.label26 = new System.Windows.Forms.Label(); this.nudBytesToGenerate = new System.Windows.Forms.NumericUpDown(); this.txtPrfSecretBytes = new System.Windows.Forms.TextBox(); this.label28 = new System.Windows.Forms.Label(); this.label27 = new System.Windows.Forms.Label(); this.txtPrfLabel = new System.Windows.Forms.TextBox(); this.label25 = new System.Windows.Forms.Label(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tabControl.SuspendLayout(); this.tabHandshakeMessages.SuspendLayout(); this.groupBox8.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox10.SuspendLayout(); this.groupBox9.SuspendLayout(); this.tabDebuggingInput.SuspendLayout(); this.tabCertificatesInput.SuspendLayout(); this.groupBox15.SuspendLayout(); this.groupBox14.SuspendLayout(); this.groupBox13.SuspendLayout(); this.tabCertificatesOutput.SuspendLayout(); this.groupBox18.SuspendLayout(); this.groupBox17.SuspendLayout(); this.groupBox16.SuspendLayout(); this.tabKeyInput.SuspendLayout(); this.tabDerivedKeys.SuspendLayout(); this.tabAppDataInput.SuspendLayout(); this.tabDecryptedAppData.SuspendLayout(); this.groupBox12.SuspendLayout(); this.groupBox11.SuspendLayout(); this.tabHmac.SuspendLayout(); this.groupBox5.SuspendLayout(); this.groupBox7.SuspendLayout(); this.groupBox6.SuspendLayout(); this.groupBox4.SuspendLayout(); this.tabPrf.SuspendLayout(); this.groupBox3.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudBytesToGenerate)).BeginInit(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(6, 12); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(438, 13); this.label1.TabIndex = 0; this.label1.Text = "All bytes should be copied from TLS records in WireShark using \"Bytes (Hex Stream" + ")\" mode"; // // btnGo // this.btnGo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnGo.Location = new System.Drawing.Point(750, 263); this.btnGo.Name = "btnGo"; this.btnGo.Size = new System.Drawing.Size(146, 24); this.btnGo.TabIndex = 1; this.btnGo.Text = "&Calculate Verify Messages"; this.btnGo.UseVisualStyleBackColor = true; this.btnGo.Click += new System.EventHandler(this.btnGo_Click); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(124, 16); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(63, 13); this.label2.TabIndex = 2; this.label2.Text = "Client Hello:"; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(119, 44); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(68, 13); this.label3.TabIndex = 4; this.label3.Text = "Server Hello:"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(90, 72); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(97, 13); this.label4.TabIndex = 6; this.label4.Text = "(Server) Certificate:"; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(90, 100); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(97, 13); this.label5.TabIndex = 8; this.label5.Text = "Server Hello Done:"; // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(82, 128); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(105, 13); this.label6.TabIndex = 10; this.label6.Text = "Client Key Exchange"; // // label7 // this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(44, 156); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(143, 13); this.label7.TabIndex = 12; this.label7.Text = "(Client) Change Cipher Spec:"; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(193, 153); this.textBox1.Name = "textBox1"; this.textBox1.ReadOnly = true; this.textBox1.Size = new System.Drawing.Size(703, 20); this.textBox1.TabIndex = 13; this.textBox1.Text = "140301000101"; // // label8 // this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(6, 184); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(181, 13); this.label8.TabIndex = 14; this.label8.Text = "(Client) Encrypted Finished Message:"; // // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(39, 212); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(148, 13); this.label9.TabIndex = 16; this.label9.Text = "(Server) Change Cipher Spec:"; // // txtServerChangeCipherSpec // this.txtServerChangeCipherSpec.Location = new System.Drawing.Point(193, 209); this.txtServerChangeCipherSpec.Name = "txtServerChangeCipherSpec"; this.txtServerChangeCipherSpec.ReadOnly = true; this.txtServerChangeCipherSpec.Size = new System.Drawing.Size(703, 20); this.txtServerChangeCipherSpec.TabIndex = 17; this.txtServerChangeCipherSpec.Text = "140301000101"; // // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(1, 240); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(186, 13); this.label10.TabIndex = 18; this.label10.Text = "(Server) Encrypted Finished Message:"; // // label11 // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(6, 18); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(201, 13); this.label11.TabIndex = 20; this.label11.Text = "Pre-Master Secret from SSLDEBUGFILE:"; // // label12 // this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(6, 107); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(279, 13); this.label12.TabIndex = 22; this.label12.Text = "Decrypted Client Key Exchange from custom Firefox build:"; // // txtDecryptedClientKeyExchange // this.txtDecryptedClientKeyExchange.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "DecryptedClientKeyExchange", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtDecryptedClientKeyExchange.Location = new System.Drawing.Point(7, 123); this.txtDecryptedClientKeyExchange.Multiline = true; this.txtDecryptedClientKeyExchange.Name = "txtDecryptedClientKeyExchange"; this.txtDecryptedClientKeyExchange.Size = new System.Drawing.Size(899, 67); this.txtDecryptedClientKeyExchange.TabIndex = 23; this.txtDecryptedClientKeyExchange.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.DecryptedClientKeyExchange; // // label13 // this.label13.AutoSize = true; this.label13.Location = new System.Drawing.Point(6, 19); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(184, 13); this.label13.TabIndex = 24; this.label13.Text = "Client\'s First Application Data Record:"; // // label14 // this.label14.AutoSize = true; this.label14.Location = new System.Drawing.Point(8, 233); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(186, 13); this.label14.TabIndex = 26; this.label14.Text = "Server\'s First Application Data Record"; // // tabControl // this.tabControl.Controls.Add(this.tabHandshakeMessages); this.tabControl.Controls.Add(this.tabDebuggingInput); this.tabControl.Controls.Add(this.tabCertificatesInput); this.tabControl.Controls.Add(this.tabCertificatesOutput); this.tabControl.Controls.Add(this.tabKeyInput); this.tabControl.Controls.Add(this.tabDerivedKeys); this.tabControl.Controls.Add(this.tabAppDataInput); this.tabControl.Controls.Add(this.tabDecryptedAppData); this.tabControl.Controls.Add(this.tabHmac); this.tabControl.Controls.Add(this.tabPrf); this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl.Location = new System.Drawing.Point(3, 3); this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; this.tabControl.Size = new System.Drawing.Size(921, 479); this.tabControl.TabIndex = 28; // // tabHandshakeMessages // this.tabHandshakeMessages.Controls.Add(this.groupBox8); this.tabHandshakeMessages.Controls.Add(this.groupBox1); this.tabHandshakeMessages.Controls.Add(this.label1); this.tabHandshakeMessages.Location = new System.Drawing.Point(4, 22); this.tabHandshakeMessages.Name = "tabHandshakeMessages"; this.tabHandshakeMessages.Padding = new System.Windows.Forms.Padding(3); this.tabHandshakeMessages.Size = new System.Drawing.Size(913, 453); this.tabHandshakeMessages.TabIndex = 0; this.tabHandshakeMessages.Text = "Wireshark Handshake Messages"; this.tabHandshakeMessages.UseVisualStyleBackColor = true; // // groupBox8 // this.groupBox8.Controls.Add(this.label2); this.groupBox8.Controls.Add(this.label8); this.groupBox8.Controls.Add(this.btnGo); this.groupBox8.Controls.Add(this.txtClientEncryptedFinishedMessage); this.groupBox8.Controls.Add(this.textBox1); this.groupBox8.Controls.Add(this.label9); this.groupBox8.Controls.Add(this.txtClientHello); this.groupBox8.Controls.Add(this.label7); this.groupBox8.Controls.Add(this.label3); this.groupBox8.Controls.Add(this.txtServerChangeCipherSpec); this.groupBox8.Controls.Add(this.txtServerHello); this.groupBox8.Controls.Add(this.txtClientKeyExchange); this.groupBox8.Controls.Add(this.label4); this.groupBox8.Controls.Add(this.label10); this.groupBox8.Controls.Add(this.txtServerHelloCertificate); this.groupBox8.Controls.Add(this.label6); this.groupBox8.Controls.Add(this.label5); this.groupBox8.Controls.Add(this.txtServerEncryptedHandshakeMessage); this.groupBox8.Controls.Add(this.txtServerHelloDone); this.groupBox8.Location = new System.Drawing.Point(6, 28); this.groupBox8.Name = "groupBox8"; this.groupBox8.Size = new System.Drawing.Size(902, 295); this.groupBox8.TabIndex = 21; this.groupBox8.TabStop = false; this.groupBox8.Text = "Input"; // // txtClientEncryptedFinishedMessage // this.txtClientEncryptedFinishedMessage.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ClientEncryptedFinishedMessage", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtClientEncryptedFinishedMessage.Location = new System.Drawing.Point(193, 181); this.txtClientEncryptedFinishedMessage.Name = "txtClientEncryptedFinishedMessage"; this.txtClientEncryptedFinishedMessage.Size = new System.Drawing.Size(703, 20); this.txtClientEncryptedFinishedMessage.TabIndex = 15; this.txtClientEncryptedFinishedMessage.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ClientEncryptedFinishedMessage; // // txtClientHello // this.txtClientHello.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ClientHello", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtClientHello.Location = new System.Drawing.Point(193, 13); this.txtClientHello.Name = "txtClientHello"; this.txtClientHello.Size = new System.Drawing.Size(703, 20); this.txtClientHello.TabIndex = 3; this.txtClientHello.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ClientHello; // // txtServerHello // this.txtServerHello.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ServerHello", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtServerHello.Location = new System.Drawing.Point(193, 41); this.txtServerHello.Name = "txtServerHello"; this.txtServerHello.Size = new System.Drawing.Size(703, 20); this.txtServerHello.TabIndex = 5; this.txtServerHello.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ServerHello; // // txtClientKeyExchange // this.txtClientKeyExchange.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ClientEncryptedKeyExchange", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtClientKeyExchange.Location = new System.Drawing.Point(193, 125); this.txtClientKeyExchange.Name = "txtClientKeyExchange"; this.txtClientKeyExchange.Size = new System.Drawing.Size(703, 20); this.txtClientKeyExchange.TabIndex = 11; this.txtClientKeyExchange.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ClientEncryptedKeyExchange; // // txtServerHelloCertificate // this.txtServerHelloCertificate.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ServerHelloCertificate", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtServerHelloCertificate.Location = new System.Drawing.Point(193, 69); this.txtServerHelloCertificate.Name = "txtServerHelloCertificate"; this.txtServerHelloCertificate.Size = new System.Drawing.Size(703, 20); this.txtServerHelloCertificate.TabIndex = 7; this.txtServerHelloCertificate.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ServerHelloCertificate; // // txtServerEncryptedHandshakeMessage // this.txtServerEncryptedHandshakeMessage.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ServerEncryptedFinishedMessage", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtServerEncryptedHandshakeMessage.Location = new System.Drawing.Point(193, 237); this.txtServerEncryptedHandshakeMessage.Name = "txtServerEncryptedHandshakeMessage"; this.txtServerEncryptedHandshakeMessage.Size = new System.Drawing.Size(703, 20); this.txtServerEncryptedHandshakeMessage.TabIndex = 19; this.txtServerEncryptedHandshakeMessage.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ServerEncryptedFinishedMessage; // // txtServerHelloDone // this.txtServerHelloDone.Location = new System.Drawing.Point(193, 97); this.txtServerHelloDone.Name = "txtServerHelloDone"; this.txtServerHelloDone.ReadOnly = true; this.txtServerHelloDone.Size = new System.Drawing.Size(703, 20); this.txtServerHelloDone.TabIndex = 9; this.txtServerHelloDone.Text = "0e000000"; // // groupBox1 // this.groupBox1.Controls.Add(this.groupBox10); this.groupBox1.Controls.Add(this.groupBox9); this.groupBox1.Location = new System.Drawing.Point(6, 329); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(902, 118); this.groupBox1.TabIndex = 20; this.groupBox1.TabStop = false; this.groupBox1.Text = "Decrypted Finished Messages (requires debugging input)"; // // groupBox10 // this.groupBox10.Controls.Add(this.txtServerFinishedHmacMd5); this.groupBox10.Controls.Add(this.label63); this.groupBox10.Controls.Add(this.label64); this.groupBox10.Controls.Add(this.txtServerFinishedVerifyData); this.groupBox10.Controls.Add(this.txtServerFinishedHeader); this.groupBox10.Controls.Add(this.label65); this.groupBox10.Location = new System.Drawing.Point(456, 19); this.groupBox10.Name = "groupBox10"; this.groupBox10.Size = new System.Drawing.Size(440, 93); this.groupBox10.TabIndex = 6; this.groupBox10.TabStop = false; this.groupBox10.Text = "Server"; // // txtServerFinishedHmacMd5 // this.txtServerFinishedHmacMd5.Location = new System.Drawing.Point(118, 67); this.txtServerFinishedHmacMd5.Name = "txtServerFinishedHmacMd5"; this.txtServerFinishedHmacMd5.ReadOnly = true; this.txtServerFinishedHmacMd5.Size = new System.Drawing.Size(316, 20); this.txtServerFinishedHmacMd5.TabIndex = 5; // // label63 // this.label63.AutoSize = true; this.label63.Location = new System.Drawing.Point(3, 71); this.label63.Name = "label63"; this.label63.Size = new System.Drawing.Size(109, 13); this.label63.TabIndex = 4; this.label63.Text = "HMAC_MD5(finished)"; // // label64 // this.label64.AutoSize = true; this.label64.Location = new System.Drawing.Point(53, 44); this.label64.Name = "label64"; this.label64.Size = new System.Drawing.Size(59, 13); this.label64.TabIndex = 3; this.label64.Text = "verify_data"; // // txtServerFinishedVerifyData // this.txtServerFinishedVerifyData.Location = new System.Drawing.Point(118, 41); this.txtServerFinishedVerifyData.Name = "txtServerFinishedVerifyData"; this.txtServerFinishedVerifyData.ReadOnly = true; this.txtServerFinishedVerifyData.Size = new System.Drawing.Size(316, 20); this.txtServerFinishedVerifyData.TabIndex = 2; // // txtServerFinishedHeader // this.txtServerFinishedHeader.Location = new System.Drawing.Point(118, 13); this.txtServerFinishedHeader.Name = "txtServerFinishedHeader"; this.txtServerFinishedHeader.ReadOnly = true; this.txtServerFinishedHeader.Size = new System.Drawing.Size(316, 20); this.txtServerFinishedHeader.TabIndex = 1; this.txtServerFinishedHeader.Text = "1400000c"; // // label65 // this.label65.AutoSize = true; this.label65.Location = new System.Drawing.Point(70, 16); this.label65.Name = "label65"; this.label65.Size = new System.Drawing.Size(42, 13); this.label65.TabIndex = 0; this.label65.Text = "Header"; // // groupBox9 // this.groupBox9.Controls.Add(this.txtClientFinishedHmacMd5); this.groupBox9.Controls.Add(this.label62); this.groupBox9.Controls.Add(this.label51); this.groupBox9.Controls.Add(this.txtClientFinishedVerifyData); this.groupBox9.Controls.Add(this.txtClientFinishedHeader); this.groupBox9.Controls.Add(this.label50); this.groupBox9.Location = new System.Drawing.Point(8, 20); this.groupBox9.Name = "groupBox9"; this.groupBox9.Size = new System.Drawing.Size(442, 93); this.groupBox9.TabIndex = 0; this.groupBox9.TabStop = false; this.groupBox9.Text = "Client"; // // txtClientFinishedHmacMd5 // this.txtClientFinishedHmacMd5.Location = new System.Drawing.Point(118, 67); this.txtClientFinishedHmacMd5.Name = "txtClientFinishedHmacMd5"; this.txtClientFinishedHmacMd5.ReadOnly = true; this.txtClientFinishedHmacMd5.Size = new System.Drawing.Size(312, 20); this.txtClientFinishedHmacMd5.TabIndex = 5; // // label62 // this.label62.AutoSize = true; this.label62.Location = new System.Drawing.Point(3, 71); this.label62.Name = "label62"; this.label62.Size = new System.Drawing.Size(109, 13); this.label62.TabIndex = 4; this.label62.Text = "HMAC_MD5(finished)"; // // label51 // this.label51.AutoSize = true; this.label51.Location = new System.Drawing.Point(53, 44); this.label51.Name = "label51"; this.label51.Size = new System.Drawing.Size(59, 13); this.label51.TabIndex = 3; this.label51.Text = "verify_data"; // // txtClientFinishedVerifyData // this.txtClientFinishedVerifyData.Location = new System.Drawing.Point(118, 41); this.txtClientFinishedVerifyData.Name = "txtClientFinishedVerifyData"; this.txtClientFinishedVerifyData.ReadOnly = true; this.txtClientFinishedVerifyData.Size = new System.Drawing.Size(312, 20); this.txtClientFinishedVerifyData.TabIndex = 2; // // txtClientFinishedHeader // this.txtClientFinishedHeader.Location = new System.Drawing.Point(118, 13); this.txtClientFinishedHeader.Name = "txtClientFinishedHeader"; this.txtClientFinishedHeader.ReadOnly = true; this.txtClientFinishedHeader.Size = new System.Drawing.Size(312, 20); this.txtClientFinishedHeader.TabIndex = 1; this.txtClientFinishedHeader.Text = "1400000c"; // // label50 // this.label50.AutoSize = true; this.label50.Location = new System.Drawing.Point(70, 16); this.label50.Name = "label50"; this.label50.Size = new System.Drawing.Size(42, 13); this.label50.TabIndex = 0; this.label50.Text = "Header"; // // tabDebuggingInput // this.tabDebuggingInput.Controls.Add(this.label11); this.tabDebuggingInput.Controls.Add(this.label12); this.tabDebuggingInput.Controls.Add(this.txtDecryptedClientKeyExchange); this.tabDebuggingInput.Controls.Add(this.txtPremasterSecret); this.tabDebuggingInput.Location = new System.Drawing.Point(4, 22); this.tabDebuggingInput.Name = "tabDebuggingInput"; this.tabDebuggingInput.Padding = new System.Windows.Forms.Padding(3); this.tabDebuggingInput.Size = new System.Drawing.Size(913, 453); this.tabDebuggingInput.TabIndex = 1; this.tabDebuggingInput.Text = "Debugging Input"; this.tabDebuggingInput.UseVisualStyleBackColor = true; // // txtPremasterSecret // this.txtPremasterSecret.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "PreMasterSecret", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtPremasterSecret.Location = new System.Drawing.Point(7, 34); this.txtPremasterSecret.Multiline = true; this.txtPremasterSecret.Name = "txtPremasterSecret"; this.txtPremasterSecret.Size = new System.Drawing.Size(900, 59); this.txtPremasterSecret.TabIndex = 21; this.txtPremasterSecret.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.PreMasterSecret; // // tabCertificatesInput // this.tabCertificatesInput.Controls.Add(this.btnCalculateCertificateInformation); this.tabCertificatesInput.Controls.Add(this.groupBox15); this.tabCertificatesInput.Controls.Add(this.groupBox14); this.tabCertificatesInput.Controls.Add(this.groupBox13); this.tabCertificatesInput.Location = new System.Drawing.Point(4, 22); this.tabCertificatesInput.Name = "tabCertificatesInput"; this.tabCertificatesInput.Padding = new System.Windows.Forms.Padding(3); this.tabCertificatesInput.Size = new System.Drawing.Size(913, 453); this.tabCertificatesInput.TabIndex = 7; this.tabCertificatesInput.Text = "Certificate Input"; this.tabCertificatesInput.UseVisualStyleBackColor = true; // // btnCalculateCertificateInformation // this.btnCalculateCertificateInformation.Location = new System.Drawing.Point(734, 424); this.btnCalculateCertificateInformation.Name = "btnCalculateCertificateInformation"; this.btnCalculateCertificateInformation.Size = new System.Drawing.Size(173, 23); this.btnCalculateCertificateInformation.TabIndex = 21; this.btnCalculateCertificateInformation.Text = "&Calculate Certificate Information"; this.btnCalculateCertificateInformation.UseVisualStyleBackColor = true; this.btnCalculateCertificateInformation.Click += new System.EventHandler(this.btnCalculateCertificateInformation_Click); // // groupBox15 // this.groupBox15.Controls.Add(this.label76); this.groupBox15.Controls.Add(this.txtVerisignClass3PrimaryCertificationAuthorityModulus); this.groupBox15.Controls.Add(this.txtVerisignClass3PrimaryCertificationAuthoritySignatureValue); this.groupBox15.Controls.Add(this.label78); this.groupBox15.Controls.Add(this.label80); this.groupBox15.Controls.Add(this.txtVerisignClass3PrimaryCertificationAuthorityPublicExponent); this.groupBox15.Location = new System.Drawing.Point(6, 281); this.groupBox15.Name = "groupBox15"; this.groupBox15.Size = new System.Drawing.Size(901, 122); this.groupBox15.TabIndex = 20; this.groupBox15.TabStop = false; this.groupBox15.Text = "Verisign Class 3 Public Primary Certification Authority"; // // label76 // this.label76.AutoSize = true; this.label76.Location = new System.Drawing.Point(4, 21); this.label76.Name = "label76"; this.label76.Size = new System.Drawing.Size(138, 13); this.label76.TabIndex = 12; this.label76.Text = "(encrypted) signature value:"; // // txtVerisignClass3PrimaryCertificationAuthorityModulus // this.txtVerisignClass3PrimaryCertificationAuthorityModulus.Location = new System.Drawing.Point(146, 70); this.txtVerisignClass3PrimaryCertificationAuthorityModulus.Multiline = true; this.txtVerisignClass3PrimaryCertificationAuthorityModulus.Name = "txtVerisignClass3PrimaryCertificationAuthorityModulus"; this.txtVerisignClass3PrimaryCertificationAuthorityModulus.Size = new System.Drawing.Size(747, 42); this.txtVerisignClass3PrimaryCertificationAuthorityModulus.TabIndex = 17; this.txtVerisignClass3PrimaryCertificationAuthorityModulus.Text = resources.GetString("txtVerisignClass3PrimaryCertificationAuthorityModulus.Text"); // // txtVerisignClass3PrimaryCertificationAuthoritySignatureValue // this.txtVerisignClass3PrimaryCertificationAuthoritySignatureValue.Location = new System.Drawing.Point(146, 17); this.txtVerisignClass3PrimaryCertificationAuthoritySignatureValue.Name = "txtVerisignClass3PrimaryCertificationAuthoritySignatureValue"; this.txtVerisignClass3PrimaryCertificationAuthoritySignatureValue.Size = new System.Drawing.Size(747, 20); this.txtVerisignClass3PrimaryCertificationAuthoritySignatureValue.TabIndex = 13; this.txtVerisignClass3PrimaryCertificationAuthoritySignatureValue.Text = resources.GetString("txtVerisignClass3PrimaryCertificationAuthoritySignatureValue.Text"); // // label78 // this.label78.AutoSize = true; this.label78.Location = new System.Drawing.Point(73, 70); this.label78.Name = "label78"; this.label78.Size = new System.Drawing.Size(69, 13); this.label78.TabIndex = 16; this.label78.Text = "Modulus \"n\":"; // // label80 // this.label80.AutoSize = true; this.label80.Location = new System.Drawing.Point(15, 49); this.label80.Name = "label80"; this.label80.Size = new System.Drawing.Size(127, 13); this.label80.TabIndex = 15; this.label80.Text = "Public Key Exponent \"e\":"; // // txtVerisignClass3PrimaryCertificationAuthorityPublicExponent // this.txtVerisignClass3PrimaryCertificationAuthorityPublicExponent.Location = new System.Drawing.Point(146, 45); this.txtVerisignClass3PrimaryCertificationAuthorityPublicExponent.Name = "txtVerisignClass3PrimaryCertificationAuthorityPublicExponent"; this.txtVerisignClass3PrimaryCertificationAuthorityPublicExponent.Size = new System.Drawing.Size(747, 20); this.txtVerisignClass3PrimaryCertificationAuthorityPublicExponent.TabIndex = 14; this.txtVerisignClass3PrimaryCertificationAuthorityPublicExponent.Text = "010001"; // // groupBox14 // this.groupBox14.Controls.Add(this.label75); this.groupBox14.Controls.Add(this.txtVersignClass3SecureServerSignedCertificate); this.groupBox14.Controls.Add(this.txtVerisignClass3SecureServerModulus); this.groupBox14.Controls.Add(this.txtVerisignClass3SecureServerSignatureValue); this.groupBox14.Controls.Add(this.label72); this.groupBox14.Controls.Add(this.label74); this.groupBox14.Controls.Add(this.label73); this.groupBox14.Controls.Add(this.txtVerisignClass3SecureServerPublicExponent); this.groupBox14.Location = new System.Drawing.Point(6, 141); this.groupBox14.Name = "groupBox14"; this.groupBox14.Size = new System.Drawing.Size(901, 137); this.groupBox14.TabIndex = 5; this.groupBox14.TabStop = false; this.groupBox14.Text = "VeriSign Class 3 Secure Server CA"; // // label75 // this.label75.AutoSize = true; this.label75.Location = new System.Drawing.Point(4, 42); this.label75.Name = "label75"; this.label75.Size = new System.Drawing.Size(138, 13); this.label75.TabIndex = 12; this.label75.Text = "(encrypted) signature value:"; // // txtVersignClass3SecureServerSignedCertificate // this.txtVersignClass3SecureServerSignedCertificate.Location = new System.Drawing.Point(146, 17); this.txtVersignClass3SecureServerSignedCertificate.Name = "txtVersignClass3SecureServerSignedCertificate"; this.txtVersignClass3SecureServerSignedCertificate.Size = new System.Drawing.Size(747, 20); this.txtVersignClass3SecureServerSignedCertificate.TabIndex = 11; this.txtVersignClass3SecureServerSignedCertificate.Text = resources.GetString("txtVersignClass3SecureServerSignedCertificate.Text"); // // txtVerisignClass3SecureServerModulus // this.txtVerisignClass3SecureServerModulus.Location = new System.Drawing.Point(146, 88); this.txtVerisignClass3SecureServerModulus.Multiline = true; this.txtVerisignClass3SecureServerModulus.Name = "txtVerisignClass3SecureServerModulus"; this.txtVerisignClass3SecureServerModulus.Size = new System.Drawing.Size(747, 42); this.txtVerisignClass3SecureServerModulus.TabIndex = 17; this.txtVerisignClass3SecureServerModulus.Text = resources.GetString("txtVerisignClass3SecureServerModulus.Text"); // // txtVerisignClass3SecureServerSignatureValue // this.txtVerisignClass3SecureServerSignatureValue.Location = new System.Drawing.Point(146, 38); this.txtVerisignClass3SecureServerSignatureValue.Name = "txtVerisignClass3SecureServerSignatureValue"; this.txtVerisignClass3SecureServerSignatureValue.Size = new System.Drawing.Size(747, 20); this.txtVerisignClass3SecureServerSignatureValue.TabIndex = 13; this.txtVerisignClass3SecureServerSignatureValue.Text = resources.GetString("txtVerisignClass3SecureServerSignatureValue.Text"); // // label72 // this.label72.AutoSize = true; this.label72.Location = new System.Drawing.Point(73, 88); this.label72.Name = "label72"; this.label72.Size = new System.Drawing.Size(69, 13); this.label72.TabIndex = 16; this.label72.Text = "Modulus \"n\":"; // // label74 // this.label74.AutoSize = true; this.label74.Location = new System.Drawing.Point(54, 21); this.label74.Name = "label74"; this.label74.Size = new System.Drawing.Size(88, 13); this.label74.TabIndex = 10; this.label74.Text = "signedCertificate:"; // // label73 // this.label73.AutoSize = true; this.label73.Location = new System.Drawing.Point(15, 67); this.label73.Name = "label73"; this.label73.Size = new System.Drawing.Size(127, 13); this.label73.TabIndex = 15; this.label73.Text = "Public Key Exponent \"e\":"; // // txtVerisignClass3SecureServerPublicExponent // this.txtVerisignClass3SecureServerPublicExponent.Location = new System.Drawing.Point(146, 63); this.txtVerisignClass3SecureServerPublicExponent.Name = "txtVerisignClass3SecureServerPublicExponent"; this.txtVerisignClass3SecureServerPublicExponent.Size = new System.Drawing.Size(747, 20); this.txtVerisignClass3SecureServerPublicExponent.TabIndex = 14; this.txtVerisignClass3SecureServerPublicExponent.Text = "010001 "; // // groupBox13 // this.groupBox13.Controls.Add(this.txtAmazonModulus); this.groupBox13.Controls.Add(this.label69); this.groupBox13.Controls.Add(this.label68); this.groupBox13.Controls.Add(this.txtAmazonPublicExponent); this.groupBox13.Controls.Add(this.label66); this.groupBox13.Controls.Add(this.txtAmazonSignatureValue); this.groupBox13.Controls.Add(this.label67); this.groupBox13.Controls.Add(this.txtAmazonSignedCertificate); this.groupBox13.Location = new System.Drawing.Point(6, -2); this.groupBox13.Name = "groupBox13"; this.groupBox13.Size = new System.Drawing.Size(901, 137); this.groupBox13.TabIndex = 4; this.groupBox13.TabStop = false; this.groupBox13.Text = "www.amazon.com"; // // txtAmazonModulus // this.txtAmazonModulus.Location = new System.Drawing.Point(146, 90); this.txtAmazonModulus.Multiline = true; this.txtAmazonModulus.Name = "txtAmazonModulus"; this.txtAmazonModulus.Size = new System.Drawing.Size(747, 42); this.txtAmazonModulus.TabIndex = 7; this.txtAmazonModulus.Text = resources.GetString("txtAmazonModulus.Text"); // // label69 // this.label69.AutoSize = true; this.label69.Location = new System.Drawing.Point(73, 90); this.label69.Name = "label69"; this.label69.Size = new System.Drawing.Size(69, 13); this.label69.TabIndex = 6; this.label69.Text = "Modulus \"n\":"; // // label68 // this.label68.AutoSize = true; this.label68.Location = new System.Drawing.Point(15, 69); this.label68.Name = "label68"; this.label68.Size = new System.Drawing.Size(127, 13); this.label68.TabIndex = 5; this.label68.Text = "Public Key Exponent \"e\":"; // // txtAmazonPublicExponent // this.txtAmazonPublicExponent.Location = new System.Drawing.Point(146, 65); this.txtAmazonPublicExponent.Name = "txtAmazonPublicExponent"; this.txtAmazonPublicExponent.Size = new System.Drawing.Size(747, 20); this.txtAmazonPublicExponent.TabIndex = 4; this.txtAmazonPublicExponent.Text = "010001 "; // // label66 // this.label66.AutoSize = true; this.label66.Location = new System.Drawing.Point(54, 22); this.label66.Name = "label66"; this.label66.Size = new System.Drawing.Size(88, 13); this.label66.TabIndex = 0; this.label66.Text = "signedCertificate:"; // // txtAmazonSignatureValue // this.txtAmazonSignatureValue.Location = new System.Drawing.Point(146, 40); this.txtAmazonSignatureValue.Name = "txtAmazonSignatureValue"; this.txtAmazonSignatureValue.Size = new System.Drawing.Size(747, 20); this.txtAmazonSignatureValue.TabIndex = 3; this.txtAmazonSignatureValue.Text = resources.GetString("txtAmazonSignatureValue.Text"); // // label67 // this.label67.AutoSize = true; this.label67.Location = new System.Drawing.Point(4, 44); this.label67.Name = "label67"; this.label67.Size = new System.Drawing.Size(138, 13); this.label67.TabIndex = 2; this.label67.Text = "(encrypted) signature value:"; // // txtAmazonSignedCertificate // this.txtAmazonSignedCertificate.Location = new System.Drawing.Point(146, 18); this.txtAmazonSignedCertificate.Name = "txtAmazonSignedCertificate"; this.txtAmazonSignedCertificate.Size = new System.Drawing.Size(747, 20); this.txtAmazonSignedCertificate.TabIndex = 1; this.txtAmazonSignedCertificate.Text = resources.GetString("txtAmazonSignedCertificate.Text"); // // tabCertificatesOutput // this.tabCertificatesOutput.Controls.Add(this.groupBox18); this.tabCertificatesOutput.Controls.Add(this.groupBox17); this.tabCertificatesOutput.Controls.Add(this.groupBox16); this.tabCertificatesOutput.Location = new System.Drawing.Point(4, 22); this.tabCertificatesOutput.Name = "tabCertificatesOutput"; this.tabCertificatesOutput.Size = new System.Drawing.Size(913, 453); this.tabCertificatesOutput.TabIndex = 9; this.tabCertificatesOutput.Text = "Certificate Output"; this.tabCertificatesOutput.UseVisualStyleBackColor = true; // // groupBox18 // this.groupBox18.Controls.Add(this.txtVerisignClass3PrimaryCertificationAuthorityHashValue); this.groupBox18.Controls.Add(this.label87); this.groupBox18.Controls.Add(this.label77); this.groupBox18.Controls.Add(this.txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature); this.groupBox18.Controls.Add(this.txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId); this.groupBox18.Controls.Add(this.label88); this.groupBox18.Controls.Add(this.txtVerisignClass3PrimaryCertificationAuthorityModulusBase10); this.groupBox18.Controls.Add(this.label86); this.groupBox18.Location = new System.Drawing.Point(3, 282); this.groupBox18.Name = "groupBox18"; this.groupBox18.Size = new System.Drawing.Size(905, 133); this.groupBox18.TabIndex = 14; this.groupBox18.TabStop = false; this.groupBox18.Text = "Verisign Class 3 Public Primary Certification Authority"; // // txtVerisignClass3PrimaryCertificationAuthorityHashValue // this.txtVerisignClass3PrimaryCertificationAuthorityHashValue.Location = new System.Drawing.Point(113, 111); this.txtVerisignClass3PrimaryCertificationAuthorityHashValue.Name = "txtVerisignClass3PrimaryCertificationAuthorityHashValue"; this.txtVerisignClass3PrimaryCertificationAuthorityHashValue.ReadOnly = true; this.txtVerisignClass3PrimaryCertificationAuthorityHashValue.Size = new System.Drawing.Size(782, 20); this.txtVerisignClass3PrimaryCertificationAuthorityHashValue.TabIndex = 33; // // label87 // this.label87.AutoSize = true; this.label87.Location = new System.Drawing.Point(18, 26); this.label87.Name = "label87"; this.label87.Size = new System.Drawing.Size(92, 13); this.label87.TabIndex = 26; this.label87.Text = "Modulus Base-10:"; // // label77 // this.label77.AutoSize = true; this.label77.Location = new System.Drawing.Point(15, 88); this.label77.Name = "label77"; this.label77.Size = new System.Drawing.Size(95, 13); this.label77.TabIndex = 30; this.label77.Text = "Hash Algorithm ID:"; // // txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature // this.txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature.Location = new System.Drawing.Point(113, 53); this.txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature.Name = "txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature"; this.txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature.ReadOnly = true; this.txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature.Size = new System.Drawing.Size(782, 20); this.txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature.TabIndex = 29; // // txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId // this.txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId.Location = new System.Drawing.Point(113, 85); this.txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId.Name = "txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId"; this.txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId.ReadOnly = true; this.txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId.Size = new System.Drawing.Size(782, 20); this.txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId.TabIndex = 32; // // label88 // this.label88.AutoSize = true; this.label88.Location = new System.Drawing.Point(3, 56); this.label88.Name = "label88"; this.label88.Size = new System.Drawing.Size(107, 13); this.label88.TabIndex = 28; this.label88.Text = "Decrypted Signature:"; // // txtVerisignClass3PrimaryCertificationAuthorityModulusBase10 // this.txtVerisignClass3PrimaryCertificationAuthorityModulusBase10.Location = new System.Drawing.Point(113, 23); this.txtVerisignClass3PrimaryCertificationAuthorityModulusBase10.Multiline = true; this.txtVerisignClass3PrimaryCertificationAuthorityModulusBase10.Name = "txtVerisignClass3PrimaryCertificationAuthorityModulusBase10"; this.txtVerisignClass3PrimaryCertificationAuthorityModulusBase10.ReadOnly = true; this.txtVerisignClass3PrimaryCertificationAuthorityModulusBase10.Size = new System.Drawing.Size(782, 24); this.txtVerisignClass3PrimaryCertificationAuthorityModulusBase10.TabIndex = 27; // // label86 // this.label86.AutoSize = true; this.label86.Location = new System.Drawing.Point(45, 113); this.label86.Name = "label86"; this.label86.Size = new System.Drawing.Size(65, 13); this.label86.TabIndex = 31; this.label86.Text = "Hash Value:"; // // groupBox17 // this.groupBox17.Controls.Add(this.txtVerisignClass3SecureServerHashValue); this.groupBox17.Controls.Add(this.label83); this.groupBox17.Controls.Add(this.txtVerisignClass3SecureServerHashAlgorithmId); this.groupBox17.Controls.Add(this.txtVerisignClass3SecureServerModulusBase10); this.groupBox17.Controls.Add(this.label71); this.groupBox17.Controls.Add(this.label85); this.groupBox17.Controls.Add(this.label84); this.groupBox17.Controls.Add(this.txtVerisignClass3SecureServerDecryptedSignature); this.groupBox17.Location = new System.Drawing.Point(3, 142); this.groupBox17.Name = "groupBox17"; this.groupBox17.Size = new System.Drawing.Size(905, 133); this.groupBox17.TabIndex = 13; this.groupBox17.TabStop = false; this.groupBox17.Text = "VeriSign Class 3 Secure Server CA"; // // txtVerisignClass3SecureServerHashValue // this.txtVerisignClass3SecureServerHashValue.Location = new System.Drawing.Point(113, 107); this.txtVerisignClass3SecureServerHashValue.Name = "txtVerisignClass3SecureServerHashValue"; this.txtVerisignClass3SecureServerHashValue.ReadOnly = true; this.txtVerisignClass3SecureServerHashValue.Size = new System.Drawing.Size(782, 20); this.txtVerisignClass3SecureServerHashValue.TabIndex = 25; // // label83 // this.label83.AutoSize = true; this.label83.Location = new System.Drawing.Point(15, 84); this.label83.Name = "label83"; this.label83.Size = new System.Drawing.Size(95, 13); this.label83.TabIndex = 22; this.label83.Text = "Hash Algorithm ID:"; // // txtVerisignClass3SecureServerHashAlgorithmId // this.txtVerisignClass3SecureServerHashAlgorithmId.Location = new System.Drawing.Point(113, 81); this.txtVerisignClass3SecureServerHashAlgorithmId.Name = "txtVerisignClass3SecureServerHashAlgorithmId"; this.txtVerisignClass3SecureServerHashAlgorithmId.ReadOnly = true; this.txtVerisignClass3SecureServerHashAlgorithmId.Size = new System.Drawing.Size(782, 20); this.txtVerisignClass3SecureServerHashAlgorithmId.TabIndex = 24; // // txtVerisignClass3SecureServerModulusBase10 // this.txtVerisignClass3SecureServerModulusBase10.Location = new System.Drawing.Point(113, 19); this.txtVerisignClass3SecureServerModulusBase10.Multiline = true; this.txtVerisignClass3SecureServerModulusBase10.Name = "txtVerisignClass3SecureServerModulusBase10"; this.txtVerisignClass3SecureServerModulusBase10.ReadOnly = true; this.txtVerisignClass3SecureServerModulusBase10.Size = new System.Drawing.Size(782, 24); this.txtVerisignClass3SecureServerModulusBase10.TabIndex = 19; // // label71 // this.label71.AutoSize = true; this.label71.Location = new System.Drawing.Point(45, 109); this.label71.Name = "label71"; this.label71.Size = new System.Drawing.Size(65, 13); this.label71.TabIndex = 23; this.label71.Text = "Hash Value:"; // // label85 // this.label85.AutoSize = true; this.label85.Location = new System.Drawing.Point(18, 22); this.label85.Name = "label85"; this.label85.Size = new System.Drawing.Size(92, 13); this.label85.TabIndex = 18; this.label85.Text = "Modulus Base-10:"; // // label84 // this.label84.AutoSize = true; this.label84.Location = new System.Drawing.Point(3, 52); this.label84.Name = "label84"; this.label84.Size = new System.Drawing.Size(107, 13); this.label84.TabIndex = 20; this.label84.Text = "Decrypted Signature:"; // // txtVerisignClass3SecureServerDecryptedSignature // this.txtVerisignClass3SecureServerDecryptedSignature.Location = new System.Drawing.Point(113, 49); this.txtVerisignClass3SecureServerDecryptedSignature.Name = "txtVerisignClass3SecureServerDecryptedSignature"; this.txtVerisignClass3SecureServerDecryptedSignature.ReadOnly = true; this.txtVerisignClass3SecureServerDecryptedSignature.Size = new System.Drawing.Size(782, 20); this.txtVerisignClass3SecureServerDecryptedSignature.TabIndex = 21; // // groupBox16 // this.groupBox16.Controls.Add(this.txtAmazonHashValue); this.groupBox16.Controls.Add(this.txtAmazonHashAlgorithmId); this.groupBox16.Controls.Add(this.label82); this.groupBox16.Controls.Add(this.label79); this.groupBox16.Controls.Add(this.txtAmazonDecryptedSignature); this.groupBox16.Controls.Add(this.label81); this.groupBox16.Controls.Add(this.label70); this.groupBox16.Controls.Add(this.txtAmazonModulusBase10); this.groupBox16.Location = new System.Drawing.Point(3, 3); this.groupBox16.Name = "groupBox16"; this.groupBox16.Size = new System.Drawing.Size(905, 133); this.groupBox16.TabIndex = 12; this.groupBox16.TabStop = false; this.groupBox16.Text = "www.amazon.com"; // // txtAmazonHashValue // this.txtAmazonHashValue.Location = new System.Drawing.Point(113, 101); this.txtAmazonHashValue.Name = "txtAmazonHashValue"; this.txtAmazonHashValue.ReadOnly = true; this.txtAmazonHashValue.Size = new System.Drawing.Size(782, 20); this.txtAmazonHashValue.TabIndex = 17; // // txtAmazonHashAlgorithmId // this.txtAmazonHashAlgorithmId.Location = new System.Drawing.Point(113, 76); this.txtAmazonHashAlgorithmId.Name = "txtAmazonHashAlgorithmId"; this.txtAmazonHashAlgorithmId.ReadOnly = true; this.txtAmazonHashAlgorithmId.Size = new System.Drawing.Size(782, 20); this.txtAmazonHashAlgorithmId.TabIndex = 16; // // label82 // this.label82.AutoSize = true; this.label82.Location = new System.Drawing.Point(45, 103); this.label82.Name = "label82"; this.label82.Size = new System.Drawing.Size(65, 13); this.label82.TabIndex = 15; this.label82.Text = "Hash Value:"; // // label79 // this.label79.AutoSize = true; this.label79.Location = new System.Drawing.Point(15, 78); this.label79.Name = "label79"; this.label79.Size = new System.Drawing.Size(95, 13); this.label79.TabIndex = 14; this.label79.Text = "Hash Algorithm ID:"; // // txtAmazonDecryptedSignature // this.txtAmazonDecryptedSignature.Location = new System.Drawing.Point(113, 43); this.txtAmazonDecryptedSignature.Name = "txtAmazonDecryptedSignature"; this.txtAmazonDecryptedSignature.ReadOnly = true; this.txtAmazonDecryptedSignature.Size = new System.Drawing.Size(782, 20); this.txtAmazonDecryptedSignature.TabIndex = 13; // // label81 // this.label81.AutoSize = true; this.label81.Location = new System.Drawing.Point(3, 46); this.label81.Name = "label81"; this.label81.Size = new System.Drawing.Size(107, 13); this.label81.TabIndex = 12; this.label81.Text = "Decrypted Signature:"; // // label70 // this.label70.AutoSize = true; this.label70.Location = new System.Drawing.Point(18, 16); this.label70.Name = "label70"; this.label70.Size = new System.Drawing.Size(92, 13); this.label70.TabIndex = 10; this.label70.Text = "Modulus Base-10:"; // // txtAmazonModulusBase10 // this.txtAmazonModulusBase10.Location = new System.Drawing.Point(113, 13); this.txtAmazonModulusBase10.Multiline = true; this.txtAmazonModulusBase10.Name = "txtAmazonModulusBase10"; this.txtAmazonModulusBase10.ReadOnly = true; this.txtAmazonModulusBase10.Size = new System.Drawing.Size(782, 24); this.txtAmazonModulusBase10.TabIndex = 11; // // tabKeyInput // this.tabKeyInput.Controls.Add(this.txtServerFinishedLabel); this.tabKeyInput.Controls.Add(this.label61); this.tabKeyInput.Controls.Add(this.txtClientFinishedLabel); this.tabKeyInput.Controls.Add(this.label60); this.tabKeyInput.Controls.Add(this.txtSha1HandshakeMessages); this.tabKeyInput.Controls.Add(this.txtMd5HandshakeMessages); this.tabKeyInput.Controls.Add(this.label59); this.tabKeyInput.Controls.Add(this.label58); this.tabKeyInput.Controls.Add(this.label57); this.tabKeyInput.Controls.Add(this.txtHandshakeMessages); this.tabKeyInput.Controls.Add(this.txtKeyExpansionLabel); this.tabKeyInput.Controls.Add(this.label56); this.tabKeyInput.Controls.Add(this.label54); this.tabKeyInput.Controls.Add(this.label53); this.tabKeyInput.Controls.Add(this.label52); this.tabKeyInput.Controls.Add(this.txtMasterSecretLabel); this.tabKeyInput.Controls.Add(this.txtServerRandomBytes); this.tabKeyInput.Controls.Add(this.txtClientRandomBytes); this.tabKeyInput.Location = new System.Drawing.Point(4, 22); this.tabKeyInput.Name = "tabKeyInput"; this.tabKeyInput.Padding = new System.Windows.Forms.Padding(3); this.tabKeyInput.Size = new System.Drawing.Size(913, 453); this.tabKeyInput.TabIndex = 3; this.tabKeyInput.Text = "Key Input"; this.tabKeyInput.UseVisualStyleBackColor = true; // // txtServerFinishedLabel // this.txtServerFinishedLabel.Location = new System.Drawing.Point(204, 410); this.txtServerFinishedLabel.Name = "txtServerFinishedLabel"; this.txtServerFinishedLabel.ReadOnly = true; this.txtServerFinishedLabel.Size = new System.Drawing.Size(703, 20); this.txtServerFinishedLabel.TabIndex = 25; this.txtServerFinishedLabel.Text = "server finished"; // // label61 // this.label61.AutoSize = true; this.label61.Location = new System.Drawing.Point(25, 410); this.label61.Name = "label61"; this.label61.Size = new System.Drawing.Size(170, 13); this.label61.TabIndex = 24; this.label61.Text = "PRF Server Finished Label (string):"; // // txtClientFinishedLabel // this.txtClientFinishedLabel.Location = new System.Drawing.Point(204, 384); this.txtClientFinishedLabel.Name = "txtClientFinishedLabel"; this.txtClientFinishedLabel.ReadOnly = true; this.txtClientFinishedLabel.Size = new System.Drawing.Size(703, 20); this.txtClientFinishedLabel.TabIndex = 23; this.txtClientFinishedLabel.Text = "client finished"; // // label60 // this.label60.AutoSize = true; this.label60.Location = new System.Drawing.Point(30, 384); this.label60.Name = "label60"; this.label60.Size = new System.Drawing.Size(165, 13); this.label60.TabIndex = 22; this.label60.Text = "PRF Client Finished Label (string):"; // // txtSha1HandshakeMessages // this.txtSha1HandshakeMessages.Location = new System.Drawing.Point(204, 357); this.txtSha1HandshakeMessages.Name = "txtSha1HandshakeMessages"; this.txtSha1HandshakeMessages.ReadOnly = true; this.txtSha1HandshakeMessages.Size = new System.Drawing.Size(703, 20); this.txtSha1HandshakeMessages.TabIndex = 21; // // txtMd5HandshakeMessages // this.txtMd5HandshakeMessages.Location = new System.Drawing.Point(204, 329); this.txtMd5HandshakeMessages.Name = "txtMd5HandshakeMessages"; this.txtMd5HandshakeMessages.ReadOnly = true; this.txtMd5HandshakeMessages.Size = new System.Drawing.Size(703, 20); this.txtMd5HandshakeMessages.TabIndex = 20; // // label59 // this.label59.AutoSize = true; this.label59.Location = new System.Drawing.Point(42, 357); this.label59.Name = "label59"; this.label59.Size = new System.Drawing.Size(153, 13); this.label59.TabIndex = 19; this.label59.Text = "SHA-1(handshake_messages):"; // // label58 // this.label58.AutoSize = true; this.label58.Location = new System.Drawing.Point(50, 332); this.label58.Name = "label58"; this.label58.Size = new System.Drawing.Size(145, 13); this.label58.TabIndex = 18; this.label58.Text = "MD5(handshake_messages):"; // // label57 // this.label57.AutoSize = true; this.label57.Location = new System.Drawing.Point(82, 133); this.label57.Name = "label57"; this.label57.Size = new System.Drawing.Size(113, 13); this.label57.TabIndex = 17; this.label57.Text = "handshake_messages"; // // txtHandshakeMessages // this.txtHandshakeMessages.Location = new System.Drawing.Point(204, 133); this.txtHandshakeMessages.Multiline = true; this.txtHandshakeMessages.Name = "txtHandshakeMessages"; this.txtHandshakeMessages.ReadOnly = true; this.txtHandshakeMessages.Size = new System.Drawing.Size(703, 190); this.txtHandshakeMessages.TabIndex = 16; // // txtKeyExpansionLabel // this.txtKeyExpansionLabel.Location = new System.Drawing.Point(204, 104); this.txtKeyExpansionLabel.Name = "txtKeyExpansionLabel"; this.txtKeyExpansionLabel.ReadOnly = true; this.txtKeyExpansionLabel.Size = new System.Drawing.Size(703, 20); this.txtKeyExpansionLabel.TabIndex = 15; this.txtKeyExpansionLabel.Text = "key expansion"; // // label56 // this.label56.AutoSize = true; this.label56.Location = new System.Drawing.Point(28, 104); this.label56.Name = "label56"; this.label56.Size = new System.Drawing.Size(167, 13); this.label56.TabIndex = 14; this.label56.Text = "PRF Key Expansion Label (string):"; // // label54 // this.label54.AutoSize = true; this.label54.Location = new System.Drawing.Point(60, 71); this.label54.Name = "label54"; this.label54.Size = new System.Drawing.Size(115, 13); this.label54.TabIndex = 10; this.label54.Text = "Server Random (bytes)"; // // label53 // this.label53.AutoSize = true; this.label53.Location = new System.Drawing.Point(62, 38); this.label53.Name = "label53"; this.label53.Size = new System.Drawing.Size(113, 13); this.label53.TabIndex = 8; this.label53.Text = "Client Random (bytes):"; // // label52 // this.label52.AutoSize = true; this.label52.Location = new System.Drawing.Point(12, 9); this.label52.Name = "label52"; this.label52.Size = new System.Drawing.Size(163, 13); this.label52.TabIndex = 6; this.label52.Text = "PRF Master Secret Label (string):"; // // txtMasterSecretLabel // this.txtMasterSecretLabel.Location = new System.Drawing.Point(204, 6); this.txtMasterSecretLabel.Name = "txtMasterSecretLabel"; this.txtMasterSecretLabel.ReadOnly = true; this.txtMasterSecretLabel.Size = new System.Drawing.Size(703, 20); this.txtMasterSecretLabel.TabIndex = 7; this.txtMasterSecretLabel.Text = "master secret"; // // txtServerRandomBytes // this.txtServerRandomBytes.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ServerRandomBytes", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtServerRandomBytes.Location = new System.Drawing.Point(204, 68); this.txtServerRandomBytes.Name = "txtServerRandomBytes"; this.txtServerRandomBytes.Size = new System.Drawing.Size(703, 20); this.txtServerRandomBytes.TabIndex = 11; this.txtServerRandomBytes.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ServerRandomBytes; // // txtClientRandomBytes // this.txtClientRandomBytes.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ClientRandomBytes", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtClientRandomBytes.Location = new System.Drawing.Point(204, 35); this.txtClientRandomBytes.Name = "txtClientRandomBytes"; this.txtClientRandomBytes.Size = new System.Drawing.Size(703, 20); this.txtClientRandomBytes.TabIndex = 9; this.txtClientRandomBytes.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ClientRandomBytes; // // tabDerivedKeys // this.tabDerivedKeys.Controls.Add(this.txtServerIV); this.tabDerivedKeys.Controls.Add(this.txtClientIV); this.tabDerivedKeys.Controls.Add(this.txtServerWriteKey); this.tabDerivedKeys.Controls.Add(this.txtClientWriteKey); this.tabDerivedKeys.Controls.Add(this.txtServerWriteMacKey); this.tabDerivedKeys.Controls.Add(this.txtClientWriteMacKey); this.tabDerivedKeys.Controls.Add(this.txtMasterSecret); this.tabDerivedKeys.Controls.Add(this.label55); this.tabDerivedKeys.Controls.Add(this.label24); this.tabDerivedKeys.Controls.Add(this.label23); this.tabDerivedKeys.Controls.Add(this.label18); this.tabDerivedKeys.Controls.Add(this.label17); this.tabDerivedKeys.Controls.Add(this.label16); this.tabDerivedKeys.Controls.Add(this.label15); this.tabDerivedKeys.Location = new System.Drawing.Point(4, 22); this.tabDerivedKeys.Name = "tabDerivedKeys"; this.tabDerivedKeys.Padding = new System.Windows.Forms.Padding(3); this.tabDerivedKeys.Size = new System.Drawing.Size(913, 453); this.tabDerivedKeys.TabIndex = 8; this.tabDerivedKeys.Text = "Derived Keys"; this.tabDerivedKeys.UseVisualStyleBackColor = true; // // txtServerIV // this.txtServerIV.Location = new System.Drawing.Point(219, 232); this.txtServerIV.Name = "txtServerIV"; this.txtServerIV.ReadOnly = true; this.txtServerIV.Size = new System.Drawing.Size(688, 20); this.txtServerIV.TabIndex = 21; // // txtClientIV // this.txtClientIV.Location = new System.Drawing.Point(219, 198); this.txtClientIV.Name = "txtClientIV"; this.txtClientIV.ReadOnly = true; this.txtClientIV.Size = new System.Drawing.Size(688, 20); this.txtClientIV.TabIndex = 20; // // txtServerWriteKey // this.txtServerWriteKey.Location = new System.Drawing.Point(219, 166); this.txtServerWriteKey.Name = "txtServerWriteKey"; this.txtServerWriteKey.ReadOnly = true; this.txtServerWriteKey.Size = new System.Drawing.Size(688, 20); this.txtServerWriteKey.TabIndex = 19; // // txtClientWriteKey // this.txtClientWriteKey.Location = new System.Drawing.Point(219, 134); this.txtClientWriteKey.Name = "txtClientWriteKey"; this.txtClientWriteKey.ReadOnly = true; this.txtClientWriteKey.Size = new System.Drawing.Size(688, 20); this.txtClientWriteKey.TabIndex = 18; // // txtServerWriteMacKey // this.txtServerWriteMacKey.Location = new System.Drawing.Point(219, 103); this.txtServerWriteMacKey.Name = "txtServerWriteMacKey"; this.txtServerWriteMacKey.ReadOnly = true; this.txtServerWriteMacKey.Size = new System.Drawing.Size(688, 20); this.txtServerWriteMacKey.TabIndex = 17; // // txtClientWriteMacKey // this.txtClientWriteMacKey.Location = new System.Drawing.Point(219, 73); this.txtClientWriteMacKey.Name = "txtClientWriteMacKey"; this.txtClientWriteMacKey.ReadOnly = true; this.txtClientWriteMacKey.Size = new System.Drawing.Size(688, 20); this.txtClientWriteMacKey.TabIndex = 16; // // txtMasterSecret // this.txtMasterSecret.Location = new System.Drawing.Point(219, 17); this.txtMasterSecret.Multiline = true; this.txtMasterSecret.Name = "txtMasterSecret"; this.txtMasterSecret.ReadOnly = true; this.txtMasterSecret.Size = new System.Drawing.Size(688, 42); this.txtMasterSecret.TabIndex = 15; // // label55 // this.label55.AutoSize = true; this.label55.Location = new System.Drawing.Point(139, 17); this.label55.Name = "label55"; this.label55.Size = new System.Drawing.Size(76, 13); this.label55.TabIndex = 14; this.label55.Text = "Master Secret:"; // // label24 // this.label24.AutoSize = true; this.label24.Location = new System.Drawing.Point(5, 232); this.label24.Name = "label24"; this.label24.Size = new System.Drawing.Size(213, 13); this.label24.TabIndex = 11; this.label24.Text = "Server Write Initialization Vector (not used): "; // // label23 // this.label23.AutoSize = true; this.label23.Location = new System.Drawing.Point(10, 198); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(205, 13); this.label23.TabIndex = 10; this.label23.Text = "Client Write Initialization Vector (not used):"; // // label18 // this.label18.AutoSize = true; this.label18.Location = new System.Drawing.Point(125, 166); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(90, 13); this.label18.TabIndex = 9; this.label18.Text = "Server Write Key:"; // // label17 // this.label17.AutoSize = true; this.label17.Location = new System.Drawing.Point(130, 134); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(85, 13); this.label17.TabIndex = 8; this.label17.Text = "Client Write Key:"; // // label16 // this.label16.AutoSize = true; this.label16.Location = new System.Drawing.Point(99, 103); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(116, 13); this.label16.TabIndex = 7; this.label16.Text = "Server Write MAC Key:"; // // label15 // this.label15.AutoSize = true; this.label15.Location = new System.Drawing.Point(104, 73); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(111, 13); this.label15.TabIndex = 6; this.label15.Text = "Client Write MAC Key:"; // // tabAppDataInput // this.tabAppDataInput.Controls.Add(this.label13); this.tabAppDataInput.Controls.Add(this.label14); this.tabAppDataInput.Controls.Add(this.txtServerApplicationDataInput); this.tabAppDataInput.Controls.Add(this.txtClientApplicationDataInput); this.tabAppDataInput.Location = new System.Drawing.Point(4, 22); this.tabAppDataInput.Name = "tabAppDataInput"; this.tabAppDataInput.Padding = new System.Windows.Forms.Padding(3); this.tabAppDataInput.Size = new System.Drawing.Size(913, 453); this.tabAppDataInput.TabIndex = 2; this.tabAppDataInput.Text = "Application Data Input"; this.tabAppDataInput.UseVisualStyleBackColor = true; // // txtServerApplicationDataInput // this.txtServerApplicationDataInput.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ServerApplicationData", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtServerApplicationDataInput.Location = new System.Drawing.Point(11, 249); this.txtServerApplicationDataInput.Multiline = true; this.txtServerApplicationDataInput.Name = "txtServerApplicationDataInput"; this.txtServerApplicationDataInput.Size = new System.Drawing.Size(896, 198); this.txtServerApplicationDataInput.TabIndex = 27; this.txtServerApplicationDataInput.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ServerApplicationData; // // txtClientApplicationDataInput // this.txtClientApplicationDataInput.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "ClientApplicationData", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtClientApplicationDataInput.Location = new System.Drawing.Point(11, 35); this.txtClientApplicationDataInput.Multiline = true; this.txtClientApplicationDataInput.Name = "txtClientApplicationDataInput"; this.txtClientApplicationDataInput.Size = new System.Drawing.Size(896, 195); this.txtClientApplicationDataInput.TabIndex = 25; this.txtClientApplicationDataInput.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.ClientApplicationData; // // tabDecryptedAppData // this.tabDecryptedAppData.Controls.Add(this.groupBox12); this.tabDecryptedAppData.Controls.Add(this.groupBox11); this.tabDecryptedAppData.Location = new System.Drawing.Point(4, 22); this.tabDecryptedAppData.Name = "tabDecryptedAppData"; this.tabDecryptedAppData.Padding = new System.Windows.Forms.Padding(3); this.tabDecryptedAppData.Size = new System.Drawing.Size(913, 453); this.tabDecryptedAppData.TabIndex = 4; this.tabDecryptedAppData.Text = "Decrypted Application Data"; this.tabDecryptedAppData.UseVisualStyleBackColor = true; // // groupBox12 // this.groupBox12.Controls.Add(this.txtServerApplicationDataHmac); this.groupBox12.Controls.Add(this.txtDecryptedServerApplicationData); this.groupBox12.Controls.Add(this.label21); this.groupBox12.Controls.Add(this.label22); this.groupBox12.Location = new System.Drawing.Point(6, 215); this.groupBox12.Name = "groupBox12"; this.groupBox12.Size = new System.Drawing.Size(901, 232); this.groupBox12.TabIndex = 10; this.groupBox12.TabStop = false; this.groupBox12.Text = "Server"; // // txtServerApplicationDataHmac // this.txtServerApplicationDataHmac.Location = new System.Drawing.Point(79, 211); this.txtServerApplicationDataHmac.Name = "txtServerApplicationDataHmac"; this.txtServerApplicationDataHmac.ReadOnly = true; this.txtServerApplicationDataHmac.Size = new System.Drawing.Size(816, 20); this.txtServerApplicationDataHmac.TabIndex = 9; // // txtDecryptedServerApplicationData // this.txtDecryptedServerApplicationData.Location = new System.Drawing.Point(9, 32); this.txtDecryptedServerApplicationData.Multiline = true; this.txtDecryptedServerApplicationData.Name = "txtDecryptedServerApplicationData"; this.txtDecryptedServerApplicationData.ReadOnly = true; this.txtDecryptedServerApplicationData.Size = new System.Drawing.Size(886, 170); this.txtDecryptedServerApplicationData.TabIndex = 9; // // label21 // this.label21.AutoSize = true; this.label21.Location = new System.Drawing.Point(6, 16); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(85, 13); this.label21.TabIndex = 7; this.label21.Text = "Decrypted Data:"; // // label22 // this.label22.AutoSize = true; this.label22.Location = new System.Drawing.Point(6, 211); this.label22.Name = "label22"; this.label22.Size = new System.Drawing.Size(67, 13); this.label22.TabIndex = 8; this.label22.Text = "HMAC_MD5"; // // groupBox11 // this.groupBox11.Controls.Add(this.txtClientApplicationDataHmac); this.groupBox11.Controls.Add(this.txtDecryptedClientApplicationData); this.groupBox11.Controls.Add(this.label19); this.groupBox11.Controls.Add(this.label20); this.groupBox11.Location = new System.Drawing.Point(6, 6); this.groupBox11.Name = "groupBox11"; this.groupBox11.Size = new System.Drawing.Size(901, 203); this.groupBox11.TabIndex = 9; this.groupBox11.TabStop = false; this.groupBox11.Text = "Client"; // // txtClientApplicationDataHmac // this.txtClientApplicationDataHmac.Location = new System.Drawing.Point(79, 174); this.txtClientApplicationDataHmac.Name = "txtClientApplicationDataHmac"; this.txtClientApplicationDataHmac.ReadOnly = true; this.txtClientApplicationDataHmac.Size = new System.Drawing.Size(816, 20); this.txtClientApplicationDataHmac.TabIndex = 8; // // txtDecryptedClientApplicationData // this.txtDecryptedClientApplicationData.Location = new System.Drawing.Point(9, 32); this.txtDecryptedClientApplicationData.Multiline = true; this.txtDecryptedClientApplicationData.Name = "txtDecryptedClientApplicationData"; this.txtDecryptedClientApplicationData.ReadOnly = true; this.txtDecryptedClientApplicationData.Size = new System.Drawing.Size(886, 136); this.txtDecryptedClientApplicationData.TabIndex = 7; // // label19 // this.label19.AutoSize = true; this.label19.Location = new System.Drawing.Point(6, 16); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(85, 13); this.label19.TabIndex = 5; this.label19.Text = "Decrypted Data:"; // // label20 // this.label20.AutoSize = true; this.label20.Location = new System.Drawing.Point(6, 177); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(67, 13); this.label20.TabIndex = 6; this.label20.Text = "HMAC_MD5"; // // tabHmac // this.tabHmac.Controls.Add(this.groupBox5); this.tabHmac.Controls.Add(this.groupBox4); this.tabHmac.Controls.Add(this.label33); this.tabHmac.Location = new System.Drawing.Point(4, 22); this.tabHmac.Name = "tabHmac"; this.tabHmac.Padding = new System.Windows.Forms.Padding(3); this.tabHmac.Size = new System.Drawing.Size(913, 453); this.tabHmac.TabIndex = 6; this.tabHmac.Text = "HMAC"; this.tabHmac.UseVisualStyleBackColor = true; // // groupBox5 // this.groupBox5.Controls.Add(this.groupBox7); this.groupBox5.Controls.Add(this.txtHmacDataAsciiBytes); this.groupBox5.Controls.Add(this.label37); this.groupBox5.Controls.Add(this.txtHmacKeyAsciiBytes); this.groupBox5.Controls.Add(this.label36); this.groupBox5.Controls.Add(this.groupBox6); this.groupBox5.Location = new System.Drawing.Point(9, 143); this.groupBox5.Name = "groupBox5"; this.groupBox5.Size = new System.Drawing.Size(898, 304); this.groupBox5.TabIndex = 6; this.groupBox5.TabStop = false; this.groupBox5.Text = "Output"; // // groupBox7 // this.groupBox7.Controls.Add(this.txtHmacSha1Result); this.groupBox7.Controls.Add(this.label44); this.groupBox7.Controls.Add(this.txtHmacSha1InnerHash); this.groupBox7.Controls.Add(this.label45); this.groupBox7.Controls.Add(this.txtHmacSha1KeyXorIpad); this.groupBox7.Controls.Add(this.label46); this.groupBox7.Controls.Add(this.txtHmacSha1IpadBytes); this.groupBox7.Controls.Add(this.label47); this.groupBox7.Controls.Add(this.txtHmacSha1KeyXorOpad); this.groupBox7.Controls.Add(this.label48); this.groupBox7.Controls.Add(this.txtHmacSha1Opad); this.groupBox7.Controls.Add(this.label49); this.groupBox7.Location = new System.Drawing.Point(442, 68); this.groupBox7.Name = "groupBox7"; this.groupBox7.Size = new System.Drawing.Size(450, 230); this.groupBox7.TabIndex = 12; this.groupBox7.TabStop = false; this.groupBox7.Text = "SHA-1"; // // txtHmacSha1Result // this.txtHmacSha1Result.Location = new System.Drawing.Point(9, 204); this.txtHmacSha1Result.Name = "txtHmacSha1Result"; this.txtHmacSha1Result.ReadOnly = true; this.txtHmacSha1Result.Size = new System.Drawing.Size(435, 20); this.txtHmacSha1Result.TabIndex = 11; // // label44 // this.label44.AutoSize = true; this.label44.Location = new System.Drawing.Point(6, 179); this.label44.Name = "label44"; this.label44.Size = new System.Drawing.Size(128, 13); this.label44.TabIndex = 10; this.label44.Text = "HMAC_SHA1(Key, Data):"; // // txtHmacSha1InnerHash // this.txtHmacSha1InnerHash.Location = new System.Drawing.Point(9, 151); this.txtHmacSha1InnerHash.Name = "txtHmacSha1InnerHash"; this.txtHmacSha1InnerHash.ReadOnly = true; this.txtHmacSha1InnerHash.Size = new System.Drawing.Size(435, 20); this.txtHmacSha1InnerHash.TabIndex = 9; // // label45 // this.label45.AutoSize = true; this.label45.Location = new System.Drawing.Point(6, 131); this.label45.Name = "label45"; this.label45.Size = new System.Drawing.Size(149, 13); this.label45.TabIndex = 8; this.label45.Text = "SHA1((Key xor ipad) ++ Data):"; // // txtHmacSha1KeyXorIpad // this.txtHmacSha1KeyXorIpad.Location = new System.Drawing.Point(78, 102); this.txtHmacSha1KeyXorIpad.Name = "txtHmacSha1KeyXorIpad"; this.txtHmacSha1KeyXorIpad.ReadOnly = true; this.txtHmacSha1KeyXorIpad.Size = new System.Drawing.Size(366, 20); this.txtHmacSha1KeyXorIpad.TabIndex = 7; // // label46 // this.label46.AutoSize = true; this.label46.Location = new System.Drawing.Point(6, 105); this.label46.Name = "label46"; this.label46.Size = new System.Drawing.Size(68, 13); this.label46.TabIndex = 6; this.label46.Text = "Key xor ipad:"; // // txtHmacSha1IpadBytes // this.txtHmacSha1IpadBytes.Location = new System.Drawing.Point(78, 75); this.txtHmacSha1IpadBytes.Name = "txtHmacSha1IpadBytes"; this.txtHmacSha1IpadBytes.ReadOnly = true; this.txtHmacSha1IpadBytes.Size = new System.Drawing.Size(366, 20); this.txtHmacSha1IpadBytes.TabIndex = 5; // // label47 // this.label47.AutoSize = true; this.label47.Location = new System.Drawing.Point(6, 78); this.label47.Name = "label47"; this.label47.Size = new System.Drawing.Size(64, 13); this.label47.TabIndex = 4; this.label47.Text = "ipad (bytes):"; // // txtHmacSha1KeyXorOpad // this.txtHmacSha1KeyXorOpad.Location = new System.Drawing.Point(78, 44); this.txtHmacSha1KeyXorOpad.Name = "txtHmacSha1KeyXorOpad"; this.txtHmacSha1KeyXorOpad.ReadOnly = true; this.txtHmacSha1KeyXorOpad.Size = new System.Drawing.Size(366, 20); this.txtHmacSha1KeyXorOpad.TabIndex = 3; // // label48 // this.label48.AutoSize = true; this.label48.Location = new System.Drawing.Point(2, 47); this.label48.Name = "label48"; this.label48.Size = new System.Drawing.Size(72, 13); this.label48.TabIndex = 2; this.label48.Text = "Key xor opad:"; // // txtHmacSha1Opad // this.txtHmacSha1Opad.Location = new System.Drawing.Point(76, 13); this.txtHmacSha1Opad.Name = "txtHmacSha1Opad"; this.txtHmacSha1Opad.ReadOnly = true; this.txtHmacSha1Opad.Size = new System.Drawing.Size(368, 20); this.txtHmacSha1Opad.TabIndex = 1; // // label49 // this.label49.AutoSize = true; this.label49.Location = new System.Drawing.Point(6, 16); this.label49.Name = "label49"; this.label49.Size = new System.Drawing.Size(68, 13); this.label49.TabIndex = 0; this.label49.Text = "opad (bytes):"; // // txtHmacDataAsciiBytes // this.txtHmacDataAsciiBytes.Location = new System.Drawing.Point(104, 42); this.txtHmacDataAsciiBytes.Name = "txtHmacDataAsciiBytes"; this.txtHmacDataAsciiBytes.ReadOnly = true; this.txtHmacDataAsciiBytes.Size = new System.Drawing.Size(788, 20); this.txtHmacDataAsciiBytes.TabIndex = 4; // // label37 // this.label37.AutoSize = true; this.label37.Location = new System.Drawing.Point(6, 45); this.label37.Name = "label37"; this.label37.Size = new System.Drawing.Size(97, 13); this.label37.TabIndex = 3; this.label37.Text = "Data (ASCII bytes):"; // // txtHmacKeyAsciiBytes // this.txtHmacKeyAsciiBytes.Location = new System.Drawing.Point(104, 13); this.txtHmacKeyAsciiBytes.Name = "txtHmacKeyAsciiBytes"; this.txtHmacKeyAsciiBytes.ReadOnly = true; this.txtHmacKeyAsciiBytes.Size = new System.Drawing.Size(788, 20); this.txtHmacKeyAsciiBytes.TabIndex = 2; // // label36 // this.label36.AutoSize = true; this.label36.Location = new System.Drawing.Point(6, 16); this.label36.Name = "label36"; this.label36.Size = new System.Drawing.Size(92, 13); this.label36.TabIndex = 1; this.label36.Text = "Key (ASCII bytes):"; // // groupBox6 // this.groupBox6.Controls.Add(this.txtHmacMd5Result); this.groupBox6.Controls.Add(this.label43); this.groupBox6.Controls.Add(this.txtHmacMd5InnerHash); this.groupBox6.Controls.Add(this.label42); this.groupBox6.Controls.Add(this.txtHmacMd5KeyXorIpad); this.groupBox6.Controls.Add(this.label41); this.groupBox6.Controls.Add(this.txtHmacMd5IpadBytes); this.groupBox6.Controls.Add(this.label40); this.groupBox6.Controls.Add(this.txtHmacMd5KeyXorOpad); this.groupBox6.Controls.Add(this.label39); this.groupBox6.Controls.Add(this.txtHmacMd5Opad); this.groupBox6.Controls.Add(this.label38); this.groupBox6.Location = new System.Drawing.Point(9, 68); this.groupBox6.Name = "groupBox6"; this.groupBox6.Size = new System.Drawing.Size(427, 230); this.groupBox6.TabIndex = 0; this.groupBox6.TabStop = false; this.groupBox6.Text = "MD5"; // // txtHmacMd5Result // this.txtHmacMd5Result.Location = new System.Drawing.Point(9, 204); this.txtHmacMd5Result.Name = "txtHmacMd5Result"; this.txtHmacMd5Result.ReadOnly = true; this.txtHmacMd5Result.Size = new System.Drawing.Size(412, 20); this.txtHmacMd5Result.TabIndex = 11; // // label43 // this.label43.AutoSize = true; this.label43.Location = new System.Drawing.Point(6, 179); this.label43.Name = "label43"; this.label43.Size = new System.Drawing.Size(123, 13); this.label43.TabIndex = 10; this.label43.Text = "HMAC_MD5(Key, Data):"; // // txtHmacMd5InnerHash // this.txtHmacMd5InnerHash.Location = new System.Drawing.Point(9, 151); this.txtHmacMd5InnerHash.Name = "txtHmacMd5InnerHash"; this.txtHmacMd5InnerHash.ReadOnly = true; this.txtHmacMd5InnerHash.Size = new System.Drawing.Size(412, 20); this.txtHmacMd5InnerHash.TabIndex = 9; // // label42 // this.label42.AutoSize = true; this.label42.Location = new System.Drawing.Point(6, 131); this.label42.Name = "label42"; this.label42.Size = new System.Drawing.Size(144, 13); this.label42.TabIndex = 8; this.label42.Text = "MD5((Key xor ipad) ++ Data):"; // // txtHmacMd5KeyXorIpad // this.txtHmacMd5KeyXorIpad.Location = new System.Drawing.Point(76, 101); this.txtHmacMd5KeyXorIpad.Name = "txtHmacMd5KeyXorIpad"; this.txtHmacMd5KeyXorIpad.ReadOnly = true; this.txtHmacMd5KeyXorIpad.Size = new System.Drawing.Size(343, 20); this.txtHmacMd5KeyXorIpad.TabIndex = 7; // // label41 // this.label41.AutoSize = true; this.label41.Location = new System.Drawing.Point(6, 105); this.label41.Name = "label41"; this.label41.Size = new System.Drawing.Size(68, 13); this.label41.TabIndex = 6; this.label41.Text = "Key xor ipad:"; // // txtHmacMd5IpadBytes // this.txtHmacMd5IpadBytes.Location = new System.Drawing.Point(76, 74); this.txtHmacMd5IpadBytes.Name = "txtHmacMd5IpadBytes"; this.txtHmacMd5IpadBytes.ReadOnly = true; this.txtHmacMd5IpadBytes.Size = new System.Drawing.Size(343, 20); this.txtHmacMd5IpadBytes.TabIndex = 5; // // label40 // this.label40.AutoSize = true; this.label40.Location = new System.Drawing.Point(10, 78); this.label40.Name = "label40"; this.label40.Size = new System.Drawing.Size(64, 13); this.label40.TabIndex = 4; this.label40.Text = "ipad (bytes):"; // // txtHmacMd5KeyXorOpad // this.txtHmacMd5KeyXorOpad.Location = new System.Drawing.Point(76, 43); this.txtHmacMd5KeyXorOpad.Name = "txtHmacMd5KeyXorOpad"; this.txtHmacMd5KeyXorOpad.ReadOnly = true; this.txtHmacMd5KeyXorOpad.Size = new System.Drawing.Size(345, 20); this.txtHmacMd5KeyXorOpad.TabIndex = 3; // // label39 // this.label39.AutoSize = true; this.label39.Location = new System.Drawing.Point(2, 47); this.label39.Name = "label39"; this.label39.Size = new System.Drawing.Size(72, 13); this.label39.TabIndex = 2; this.label39.Text = "Key xor opad:"; // // txtHmacMd5Opad // this.txtHmacMd5Opad.Location = new System.Drawing.Point(76, 12); this.txtHmacMd5Opad.Name = "txtHmacMd5Opad"; this.txtHmacMd5Opad.ReadOnly = true; this.txtHmacMd5Opad.Size = new System.Drawing.Size(345, 20); this.txtHmacMd5Opad.TabIndex = 1; // // label38 // this.label38.AutoSize = true; this.label38.Location = new System.Drawing.Point(6, 16); this.label38.Name = "label38"; this.label38.Size = new System.Drawing.Size(68, 13); this.label38.TabIndex = 0; this.label38.Text = "opad (bytes):"; // // groupBox4 // this.groupBox4.Controls.Add(this.btnGenerateHmac); this.groupBox4.Controls.Add(this.label34); this.groupBox4.Controls.Add(this.txtHmacDataString); this.groupBox4.Controls.Add(this.label35); this.groupBox4.Controls.Add(this.txtHmacKeyString); this.groupBox4.Location = new System.Drawing.Point(9, 29); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(898, 108); this.groupBox4.TabIndex = 5; this.groupBox4.TabStop = false; this.groupBox4.Text = "Input"; // // btnGenerateHmac // this.btnGenerateHmac.Location = new System.Drawing.Point(721, 79); this.btnGenerateHmac.Name = "btnGenerateHmac"; this.btnGenerateHmac.Size = new System.Drawing.Size(171, 23); this.btnGenerateHmac.TabIndex = 5; this.btnGenerateHmac.Text = "&Generate HMACs"; this.btnGenerateHmac.UseVisualStyleBackColor = true; this.btnGenerateHmac.Click += new System.EventHandler(this.btnGenerateHmac_Click); // // label34 // this.label34.AutoSize = true; this.label34.Location = new System.Drawing.Point(6, 24); this.label34.Name = "label34"; this.label34.Size = new System.Drawing.Size(92, 13); this.label34.TabIndex = 1; this.label34.Text = "Key (ASCII string):"; // // txtHmacDataString // this.txtHmacDataString.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "HmacData", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtHmacDataString.Location = new System.Drawing.Point(104, 48); this.txtHmacDataString.Name = "txtHmacDataString"; this.txtHmacDataString.Size = new System.Drawing.Size(788, 20); this.txtHmacDataString.TabIndex = 4; this.txtHmacDataString.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.HmacData; // // label35 // this.label35.AutoSize = true; this.label35.Location = new System.Drawing.Point(1, 52); this.label35.Name = "label35"; this.label35.Size = new System.Drawing.Size(97, 13); this.label35.TabIndex = 2; this.label35.Text = "Data (ASCII string):"; // // txtHmacKeyString // this.txtHmacKeyString.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "HmacKey", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtHmacKeyString.Location = new System.Drawing.Point(104, 20); this.txtHmacKeyString.Name = "txtHmacKeyString"; this.txtHmacKeyString.Size = new System.Drawing.Size(788, 20); this.txtHmacKeyString.TabIndex = 3; this.txtHmacKeyString.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.HmacKey; // // label33 // this.label33.AutoSize = true; this.label33.Location = new System.Drawing.Point(6, 3); this.label33.Name = "label33"; this.label33.Size = new System.Drawing.Size(422, 13); this.label33.TabIndex = 0; this.label33.Text = "This tab demonstrates how keyed-Hashed Message Authentication Codes (HMAC) work"; // // tabPrf // this.tabPrf.Controls.Add(this.groupBox3); this.tabPrf.Controls.Add(this.groupBox2); this.tabPrf.Controls.Add(this.label25); this.tabPrf.Location = new System.Drawing.Point(4, 22); this.tabPrf.Name = "tabPrf"; this.tabPrf.Padding = new System.Windows.Forms.Padding(3); this.tabPrf.Size = new System.Drawing.Size(913, 453); this.tabPrf.TabIndex = 5; this.tabPrf.Text = "PRF"; this.tabPrf.UseVisualStyleBackColor = true; // // groupBox3 // this.groupBox3.Controls.Add(this.label32); this.groupBox3.Controls.Add(this.txtPrfAsciiLabelBytes); this.groupBox3.Controls.Add(this.label31); this.groupBox3.Controls.Add(this.txtPrfMD5Output); this.groupBox3.Controls.Add(this.label30); this.groupBox3.Controls.Add(this.txtPrfOutput); this.groupBox3.Location = new System.Drawing.Point(9, 279); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(901, 168); this.groupBox3.TabIndex = 9; this.groupBox3.TabStop = false; this.groupBox3.Text = "Output"; // // label32 // this.label32.AutoSize = true; this.label32.Location = new System.Drawing.Point(6, 43); this.label32.Name = "label32"; this.label32.Size = new System.Drawing.Size(100, 13); this.label32.TabIndex = 5; this.label32.Text = "PRF Output (bytes):"; // // txtPrfAsciiLabelBytes // this.txtPrfAsciiLabelBytes.Location = new System.Drawing.Point(109, 16); this.txtPrfAsciiLabelBytes.Name = "txtPrfAsciiLabelBytes"; this.txtPrfAsciiLabelBytes.ReadOnly = true; this.txtPrfAsciiLabelBytes.Size = new System.Drawing.Size(783, 20); this.txtPrfAsciiLabelBytes.TabIndex = 4; // // label31 // this.label31.AutoSize = true; this.label31.Location = new System.Drawing.Point(6, 16); this.label31.Name = "label31"; this.label31.Size = new System.Drawing.Size(97, 13); this.label31.TabIndex = 3; this.label31.Text = "Label ASCII (bytes)"; // // txtPrfMD5Output // this.txtPrfMD5Output.Location = new System.Drawing.Point(128, 145); this.txtPrfMD5Output.Name = "txtPrfMD5Output"; this.txtPrfMD5Output.ReadOnly = true; this.txtPrfMD5Output.Size = new System.Drawing.Size(764, 20); this.txtPrfMD5Output.TabIndex = 2; // // label30 // this.label30.AutoSize = true; this.label30.Location = new System.Drawing.Point(2, 145); this.label30.Name = "label30"; this.label30.Size = new System.Drawing.Size(120, 13); this.label30.TabIndex = 1; this.label30.Text = "PRF Output MD5 Hash:"; // // txtPrfOutput // this.txtPrfOutput.Location = new System.Drawing.Point(5, 59); this.txtPrfOutput.Multiline = true; this.txtPrfOutput.Name = "txtPrfOutput"; this.txtPrfOutput.ReadOnly = true; this.txtPrfOutput.Size = new System.Drawing.Size(887, 83); this.txtPrfOutput.TabIndex = 0; // // groupBox2 // this.groupBox2.Controls.Add(this.txtPrfSeedBytes); this.groupBox2.Controls.Add(this.label29); this.groupBox2.Controls.Add(this.btnPrfGenerate); this.groupBox2.Controls.Add(this.label26); this.groupBox2.Controls.Add(this.nudBytesToGenerate); this.groupBox2.Controls.Add(this.txtPrfSecretBytes); this.groupBox2.Controls.Add(this.label28); this.groupBox2.Controls.Add(this.label27); this.groupBox2.Controls.Add(this.txtPrfLabel); this.groupBox2.Location = new System.Drawing.Point(9, 30); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(898, 243); this.groupBox2.TabIndex = 8; this.groupBox2.TabStop = false; this.groupBox2.Text = "Input"; // // txtPrfSeedBytes // this.txtPrfSeedBytes.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "PrfSeedBytes", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtPrfSeedBytes.Location = new System.Drawing.Point(101, 108); this.txtPrfSeedBytes.Multiline = true; this.txtPrfSeedBytes.Name = "txtPrfSeedBytes"; this.txtPrfSeedBytes.Size = new System.Drawing.Size(791, 59); this.txtPrfSeedBytes.TabIndex = 9; this.txtPrfSeedBytes.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.PrfSeedBytes; // // label29 // this.label29.AutoSize = true; this.label29.Location = new System.Drawing.Point(29, 111); this.label29.Name = "label29"; this.label29.Size = new System.Drawing.Size(66, 13); this.label29.TabIndex = 8; this.label29.Text = "Seed (bytes)"; // // btnPrfGenerate // this.btnPrfGenerate.Location = new System.Drawing.Point(744, 214); this.btnPrfGenerate.Name = "btnPrfGenerate"; this.btnPrfGenerate.Size = new System.Drawing.Size(148, 23); this.btnPrfGenerate.TabIndex = 7; this.btnPrfGenerate.Text = "&Generate PRF Output"; this.btnPrfGenerate.UseVisualStyleBackColor = true; this.btnPrfGenerate.Click += new System.EventHandler(this.btnPrfGenerate_Click); // // label26 // this.label26.AutoSize = true; this.label26.Location = new System.Drawing.Point(23, 22); this.label26.Name = "label26"; this.label26.Size = new System.Drawing.Size(72, 13); this.label26.TabIndex = 1; this.label26.Text = "Secret (bytes)"; // // nudBytesToGenerate // this.nudBytesToGenerate.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "PrfBytesToGenerate", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.nudBytesToGenerate.Location = new System.Drawing.Point(101, 178); this.nudBytesToGenerate.Maximum = new decimal(new int[] { 1024, 0, 0, 0}); this.nudBytesToGenerate.Name = "nudBytesToGenerate"; this.nudBytesToGenerate.Size = new System.Drawing.Size(54, 20); this.nudBytesToGenerate.TabIndex = 6; this.nudBytesToGenerate.Value = global::Moserware.TlsAnalyzer.Properties.Settings.Default.PrfBytesToGenerate; // // txtPrfSecretBytes // this.txtPrfSecretBytes.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "PrfSecretBytes", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtPrfSecretBytes.Location = new System.Drawing.Point(101, 18); this.txtPrfSecretBytes.Multiline = true; this.txtPrfSecretBytes.Name = "txtPrfSecretBytes"; this.txtPrfSecretBytes.Size = new System.Drawing.Size(791, 56); this.txtPrfSecretBytes.TabIndex = 2; this.txtPrfSecretBytes.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.PrfSecretBytes; // // label28 // this.label28.AutoSize = true; this.label28.Location = new System.Drawing.Point(10, 180); this.label28.Name = "label28"; this.label28.Size = new System.Drawing.Size(93, 13); this.label28.TabIndex = 5; this.label28.Text = "Bytes to generate:"; // // label27 // this.label27.AutoSize = true; this.label27.Location = new System.Drawing.Point(2, 85); this.label27.Name = "label27"; this.label27.Size = new System.Drawing.Size(93, 13); this.label27.TabIndex = 3; this.label27.Text = "ASCII label (string)"; // // txtPrfLabel // this.txtPrfLabel.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Moserware.TlsAnalyzer.Properties.Settings.Default, "PrfLabel", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtPrfLabel.Location = new System.Drawing.Point(101, 82); this.txtPrfLabel.Name = "txtPrfLabel"; this.txtPrfLabel.Size = new System.Drawing.Size(791, 20); this.txtPrfLabel.TabIndex = 4; this.txtPrfLabel.Text = global::Moserware.TlsAnalyzer.Properties.Settings.Default.PrfLabel; // // label25 // this.label25.AutoSize = true; this.label25.Location = new System.Drawing.Point(6, 3); this.label25.Name = "label25"; this.label25.Size = new System.Drawing.Size(357, 13); this.label25.TabIndex = 0; this.label25.Text = "This tab lets you experiment with TLS 1.0 Pseudo Random Function (PRF)"; // // tableLayoutPanel1 // this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.Controls.Add(this.tabControl, 0, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(927, 485); this.tableLayoutPanel1.TabIndex = 29; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(927, 485); this.Controls.Add(this.tableLayoutPanel1); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "MainForm"; this.Text = "TLS 1.0 Analyzer for \"The First Few Milliseconds of an HTTPS Connection\" blog pos" + "t on moserware.com"; this.tabControl.ResumeLayout(false); this.tabHandshakeMessages.ResumeLayout(false); this.tabHandshakeMessages.PerformLayout(); this.groupBox8.ResumeLayout(false); this.groupBox8.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox10.ResumeLayout(false); this.groupBox10.PerformLayout(); this.groupBox9.ResumeLayout(false); this.groupBox9.PerformLayout(); this.tabDebuggingInput.ResumeLayout(false); this.tabDebuggingInput.PerformLayout(); this.tabCertificatesInput.ResumeLayout(false); this.groupBox15.ResumeLayout(false); this.groupBox15.PerformLayout(); this.groupBox14.ResumeLayout(false); this.groupBox14.PerformLayout(); this.groupBox13.ResumeLayout(false); this.groupBox13.PerformLayout(); this.tabCertificatesOutput.ResumeLayout(false); this.groupBox18.ResumeLayout(false); this.groupBox18.PerformLayout(); this.groupBox17.ResumeLayout(false); this.groupBox17.PerformLayout(); this.groupBox16.ResumeLayout(false); this.groupBox16.PerformLayout(); this.tabKeyInput.ResumeLayout(false); this.tabKeyInput.PerformLayout(); this.tabDerivedKeys.ResumeLayout(false); this.tabDerivedKeys.PerformLayout(); this.tabAppDataInput.ResumeLayout(false); this.tabAppDataInput.PerformLayout(); this.tabDecryptedAppData.ResumeLayout(false); this.groupBox12.ResumeLayout(false); this.groupBox12.PerformLayout(); this.groupBox11.ResumeLayout(false); this.groupBox11.PerformLayout(); this.tabHmac.ResumeLayout(false); this.tabHmac.PerformLayout(); this.groupBox5.ResumeLayout(false); this.groupBox5.PerformLayout(); this.groupBox7.ResumeLayout(false); this.groupBox7.PerformLayout(); this.groupBox6.ResumeLayout(false); this.groupBox6.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.tabPrf.ResumeLayout(false); this.tabPrf.PerformLayout(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudBytesToGenerate)).EndInit(); this.tableLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Label label1; private System.Windows.Forms.Button btnGo; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox txtClientHello; private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox txtServerHello; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox txtServerHelloCertificate; private System.Windows.Forms.Label label5; private System.Windows.Forms.TextBox txtServerHelloDone; private System.Windows.Forms.Label label6; private System.Windows.Forms.TextBox txtClientKeyExchange; private System.Windows.Forms.Label label7; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label8; private System.Windows.Forms.TextBox txtClientEncryptedFinishedMessage; private System.Windows.Forms.Label label9; private System.Windows.Forms.TextBox txtServerChangeCipherSpec; private System.Windows.Forms.Label label10; private System.Windows.Forms.TextBox txtServerEncryptedHandshakeMessage; private System.Windows.Forms.Label label11; private System.Windows.Forms.TextBox txtPremasterSecret; private System.Windows.Forms.Label label12; private System.Windows.Forms.TextBox txtDecryptedClientKeyExchange; private System.Windows.Forms.Label label13; private System.Windows.Forms.TextBox txtClientApplicationDataInput; private System.Windows.Forms.Label label14; private System.Windows.Forms.TextBox txtServerApplicationDataInput; private System.Windows.Forms.TabControl tabControl; private System.Windows.Forms.TabPage tabHandshakeMessages; private System.Windows.Forms.TabPage tabDebuggingInput; private System.Windows.Forms.TabPage tabAppDataInput; private System.Windows.Forms.TabPage tabKeyInput; private System.Windows.Forms.TabPage tabDecryptedAppData; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.Label label22; private System.Windows.Forms.Label label21; private System.Windows.Forms.Label label20; private System.Windows.Forms.Label label19; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.TabPage tabPrf; private System.Windows.Forms.TabPage tabHmac; private System.Windows.Forms.TabPage tabCertificatesInput; private System.Windows.Forms.Label label28; private System.Windows.Forms.TextBox txtPrfLabel; private System.Windows.Forms.Label label27; private System.Windows.Forms.TextBox txtPrfSecretBytes; private System.Windows.Forms.Label label26; private System.Windows.Forms.Label label25; private System.Windows.Forms.NumericUpDown nudBytesToGenerate; private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.TextBox txtPrfOutput; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.Button btnPrfGenerate; private System.Windows.Forms.TextBox txtPrfSeedBytes; private System.Windows.Forms.Label label29; private System.Windows.Forms.TextBox txtPrfMD5Output; private System.Windows.Forms.Label label30; private System.Windows.Forms.Label label32; private System.Windows.Forms.TextBox txtPrfAsciiLabelBytes; private System.Windows.Forms.Label label31; private System.Windows.Forms.Label label33; private System.Windows.Forms.TextBox txtHmacDataString; private System.Windows.Forms.TextBox txtHmacKeyString; private System.Windows.Forms.Label label35; private System.Windows.Forms.Label label34; private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.Button btnGenerateHmac; private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.TextBox txtHmacDataAsciiBytes; private System.Windows.Forms.Label label37; private System.Windows.Forms.TextBox txtHmacKeyAsciiBytes; private System.Windows.Forms.Label label36; private System.Windows.Forms.GroupBox groupBox6; private System.Windows.Forms.TextBox txtHmacMd5KeyXorOpad; private System.Windows.Forms.Label label39; private System.Windows.Forms.TextBox txtHmacMd5Opad; private System.Windows.Forms.Label label38; private System.Windows.Forms.TextBox txtHmacMd5InnerHash; private System.Windows.Forms.Label label42; private System.Windows.Forms.GroupBox groupBox7; private System.Windows.Forms.TextBox txtHmacSha1Result; private System.Windows.Forms.Label label44; private System.Windows.Forms.TextBox txtHmacSha1InnerHash; private System.Windows.Forms.Label label45; private System.Windows.Forms.TextBox txtHmacSha1KeyXorIpad; private System.Windows.Forms.Label label46; private System.Windows.Forms.TextBox txtHmacSha1IpadBytes; private System.Windows.Forms.Label label47; private System.Windows.Forms.TextBox txtHmacMd5Result; private System.Windows.Forms.Label label43; private System.Windows.Forms.TextBox txtHmacSha1KeyXorOpad; private System.Windows.Forms.Label label48; private System.Windows.Forms.TextBox txtHmacSha1Opad; private System.Windows.Forms.Label label49; private System.Windows.Forms.TextBox txtHmacMd5KeyXorIpad; private System.Windows.Forms.Label label41; private System.Windows.Forms.TextBox txtHmacMd5IpadBytes; private System.Windows.Forms.Label label40; private System.Windows.Forms.GroupBox groupBox8; private System.Windows.Forms.TextBox txtMasterSecretLabel; private System.Windows.Forms.Label label52; private System.Windows.Forms.TextBox txtClientRandomBytes; private System.Windows.Forms.Label label53; private System.Windows.Forms.TextBox txtServerRandomBytes; private System.Windows.Forms.Label label54; private System.Windows.Forms.TextBox txtKeyExpansionLabel; private System.Windows.Forms.Label label56; private System.Windows.Forms.Label label57; private System.Windows.Forms.TextBox txtHandshakeMessages; private System.Windows.Forms.TextBox txtSha1HandshakeMessages; private System.Windows.Forms.TextBox txtMd5HandshakeMessages; private System.Windows.Forms.Label label59; private System.Windows.Forms.Label label58; private System.Windows.Forms.TextBox txtClientFinishedLabel; private System.Windows.Forms.Label label60; private System.Windows.Forms.TextBox txtServerFinishedLabel; private System.Windows.Forms.Label label61; private System.Windows.Forms.TabPage tabDerivedKeys; private System.Windows.Forms.Label label24; private System.Windows.Forms.Label label23; private System.Windows.Forms.Label label18; private System.Windows.Forms.Label label17; private System.Windows.Forms.Label label16; private System.Windows.Forms.Label label15; private System.Windows.Forms.TextBox txtMasterSecret; private System.Windows.Forms.Label label55; private System.Windows.Forms.TextBox txtClientWriteMacKey; private System.Windows.Forms.TextBox txtServerWriteMacKey; private System.Windows.Forms.TextBox txtClientWriteKey; private System.Windows.Forms.TextBox txtServerWriteKey; private System.Windows.Forms.TextBox txtClientIV; private System.Windows.Forms.TextBox txtServerIV; private System.Windows.Forms.GroupBox groupBox9; private System.Windows.Forms.TextBox txtClientFinishedHeader; private System.Windows.Forms.Label label50; private System.Windows.Forms.TextBox txtClientFinishedHmacMd5; private System.Windows.Forms.Label label62; private System.Windows.Forms.Label label51; private System.Windows.Forms.TextBox txtClientFinishedVerifyData; private System.Windows.Forms.GroupBox groupBox10; private System.Windows.Forms.TextBox txtServerFinishedHmacMd5; private System.Windows.Forms.Label label63; private System.Windows.Forms.Label label64; private System.Windows.Forms.TextBox txtServerFinishedVerifyData; private System.Windows.Forms.TextBox txtServerFinishedHeader; private System.Windows.Forms.Label label65; private System.Windows.Forms.GroupBox groupBox12; private System.Windows.Forms.GroupBox groupBox11; private System.Windows.Forms.TextBox txtDecryptedClientApplicationData; private System.Windows.Forms.TextBox txtServerApplicationDataHmac; private System.Windows.Forms.TextBox txtDecryptedServerApplicationData; private System.Windows.Forms.TextBox txtClientApplicationDataHmac; private System.Windows.Forms.TextBox txtAmazonSignedCertificate; private System.Windows.Forms.Label label66; private System.Windows.Forms.GroupBox groupBox13; private System.Windows.Forms.TextBox txtAmazonModulus; private System.Windows.Forms.Label label69; private System.Windows.Forms.Label label68; private System.Windows.Forms.TextBox txtAmazonPublicExponent; private System.Windows.Forms.TextBox txtAmazonSignatureValue; private System.Windows.Forms.Label label67; private System.Windows.Forms.GroupBox groupBox14; private System.Windows.Forms.GroupBox groupBox15; private System.Windows.Forms.Label label76; private System.Windows.Forms.TextBox txtVerisignClass3PrimaryCertificationAuthorityModulus; private System.Windows.Forms.TextBox txtVerisignClass3PrimaryCertificationAuthoritySignatureValue; private System.Windows.Forms.Label label78; private System.Windows.Forms.Label label80; private System.Windows.Forms.TextBox txtVerisignClass3PrimaryCertificationAuthorityPublicExponent; private System.Windows.Forms.Label label75; private System.Windows.Forms.TextBox txtVersignClass3SecureServerSignedCertificate; private System.Windows.Forms.TextBox txtVerisignClass3SecureServerModulus; private System.Windows.Forms.TextBox txtVerisignClass3SecureServerSignatureValue; private System.Windows.Forms.Label label72; private System.Windows.Forms.Label label74; private System.Windows.Forms.Label label73; private System.Windows.Forms.TextBox txtVerisignClass3SecureServerPublicExponent; private System.Windows.Forms.TabPage tabCertificatesOutput; private System.Windows.Forms.GroupBox groupBox16; private System.Windows.Forms.TextBox txtAmazonDecryptedSignature; private System.Windows.Forms.Label label81; private System.Windows.Forms.Label label70; private System.Windows.Forms.TextBox txtAmazonModulusBase10; private System.Windows.Forms.GroupBox groupBox18; private System.Windows.Forms.GroupBox groupBox17; private System.Windows.Forms.Button btnCalculateCertificateInformation; private System.Windows.Forms.TextBox txtVerisignClass3PrimaryCertificationAuthorityHashValue; private System.Windows.Forms.Label label87; private System.Windows.Forms.Label label77; private System.Windows.Forms.TextBox txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature; private System.Windows.Forms.TextBox txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId; private System.Windows.Forms.Label label88; private System.Windows.Forms.TextBox txtVerisignClass3PrimaryCertificationAuthorityModulusBase10; private System.Windows.Forms.Label label86; private System.Windows.Forms.TextBox txtVerisignClass3SecureServerHashValue; private System.Windows.Forms.Label label83; private System.Windows.Forms.TextBox txtVerisignClass3SecureServerHashAlgorithmId; private System.Windows.Forms.TextBox txtVerisignClass3SecureServerModulusBase10; private System.Windows.Forms.Label label71; private System.Windows.Forms.Label label85; private System.Windows.Forms.Label label84; private System.Windows.Forms.TextBox txtVerisignClass3SecureServerDecryptedSignature; private System.Windows.Forms.TextBox txtAmazonHashValue; private System.Windows.Forms.TextBox txtAmazonHashAlgorithmId; private System.Windows.Forms.Label label82; private System.Windows.Forms.Label label79; } } ================================================ FILE: MainForm.cs ================================================ using System; using System.Diagnostics; using System.Linq; using System.Text; using System.Windows.Forms; using Mono.Math; namespace Moserware.TlsAnalyzer { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } private void btnGo_Click(object sender, EventArgs e) { try { byte[] preMasterSecret = FirefoxSslDebugFileUtilities.GetPremasterSecretKey(txtPremasterSecret.Text); string label = txtMasterSecretLabel.Text; byte[] serverHelloRandom = txtServerRandomBytes.Text.FromWireshark(); byte[] clientHelloRandom = txtClientRandomBytes.Text.FromWireshark(); byte[] clientHelloAndServerHello = ByteUtilities.ConcatBytes(clientHelloRandom, serverHelloRandom); byte[] masterSecret = Prf10.GenerateBytes(preMasterSecret, label, clientHelloAndServerHello, 48); txtMasterSecret.Text = masterSecret.ToDisplayByteString(); byte[] serverHelloAndClientHello = ByteUtilities.ConcatBytes(serverHelloRandom, clientHelloRandom); byte[] keyBlock = Prf10.GenerateBytes(masterSecret, txtKeyExpansionLabel.Text, serverHelloAndClientHello, 96); byte[] client_write_MAC_secret = new byte[16]; byte[] server_write_MAC_secret = new byte[16]; byte[] client_write_key = new byte[16]; byte[] server_write_key = new byte[16]; byte[] client_write_IV = new byte[16]; byte[] server_write_IV = new byte[16]; Buffer.BlockCopy(keyBlock, 0, client_write_MAC_secret, 0, 16); txtClientWriteMacKey.Text = client_write_MAC_secret.ToDisplayByteString(); Buffer.BlockCopy(keyBlock, 16, server_write_MAC_secret, 0, 16); txtServerWriteMacKey.Text = server_write_MAC_secret.ToDisplayByteString(); Buffer.BlockCopy(keyBlock, 32, client_write_key, 0, 16); txtClientWriteKey.Text = client_write_key.ToDisplayByteString(); Buffer.BlockCopy(keyBlock, 48, server_write_key, 0, 16); txtServerWriteKey.Text = server_write_key.ToDisplayByteString(); Buffer.BlockCopy(keyBlock, 64, client_write_IV, 0, 16); txtClientIV.Text = client_write_IV.ToDisplayByteString(); Buffer.BlockCopy(keyBlock, 80, server_write_IV, 0, 16); txtServerIV.Text = server_write_IV.ToDisplayByteString(); byte[] clientHello = txtClientHello.Text.FromWireshark(); byte[] serverHello = txtServerHello.Text.FromWireshark(); byte[] certificate = txtServerHelloCertificate.Text.FromWireshark(); byte[] serverHelloDone = txtServerHelloDone.Text.FromWireshark(); byte[] clientKeyExchangeEncrypted = txtClientKeyExchange.Text.FromWireshark(); byte[] handshakeMessages = ByteUtilities.ConcatBytes(clientHello, serverHello, certificate, serverHelloDone, clientKeyExchangeEncrypted); txtHandshakeMessages.Text = handshakeMessages.ToDisplayByteString(16); var md5Handshake = Hasher.ComputeMD5(handshakeMessages); txtMd5HandshakeMessages.Text = md5Handshake.ToDisplayByteString(); var sha1Handshake = Hasher.ComputeSHA1Hash(handshakeMessages); txtSha1HandshakeMessages.Text = sha1Handshake.ToDisplayByteString(); byte[] clientVerifyData = Prf10.GenerateBytes(masterSecret, txtClientFinishedLabel.Text, ByteUtilities.ConcatBytes(md5Handshake, sha1Handshake), 12); txtClientFinishedVerifyData.Text = clientVerifyData.ToDisplayByteString(); var clientFinishedHeaderBytes = txtClientFinishedHeader.Text.FromWireshark(); var clientFinishedHash = Hasher.ComputeTlsMD5Hmac(client_write_MAC_secret, 0x16, 0, ByteUtilities.ConcatBytes(clientFinishedHeaderBytes, clientVerifyData)); txtClientFinishedHmacMd5.Text = clientFinishedHash.ToDisplayByteString(); var clientFinishedHeaderAndVerify = ByteUtilities.ConcatBytes(clientFinishedHeaderBytes, clientVerifyData); var clientFinishedDecrypted = ByteUtilities.ConcatBytes(clientFinishedHeaderBytes, clientVerifyData, clientFinishedHash); Arc4 clientWriteArc4 = new Arc4(client_write_key); var clientFinishedEncrypted = clientWriteArc4.Encrypt(clientFinishedDecrypted); var expectedClientFinishedEncrypted = txtClientEncryptedFinishedMessage.Text.FromWireshark(); Debug.Assert(ByteUtilities.AreEqual(expectedClientFinishedEncrypted, clientFinishedEncrypted)); byte[] clientApplicationData = txtClientApplicationDataInput.Text.FromWireshark(); byte[] decryptedBytes = clientWriteArc4.Encrypt(clientApplicationData); byte[] plainTextBytes = new byte[decryptedBytes.Length - 16]; Buffer.BlockCopy(decryptedBytes, 0, plainTextBytes, 0, plainTextBytes.Length); string plainText = ASCIIEncoding.ASCII.GetString(plainTextBytes); txtDecryptedClientApplicationData.Text = plainText; byte[] hmacClientBytesReceived = new byte[16]; Buffer.BlockCopy(decryptedBytes, plainTextBytes.Length, hmacClientBytesReceived, 0, 16); txtClientApplicationDataHmac.Text = hmacClientBytesReceived.ToDisplayByteString(); var hmacFirstClientPacket = Hasher.ComputeTlsMD5Hmac(client_write_MAC_secret, 23, 1, plainTextBytes); Debug.Assert(ByteUtilities.AreEqual(hmacFirstClientPacket, hmacClientBytesReceived)); // get server reply var serverHandshakeMessages = ByteUtilities.ConcatBytes(handshakeMessages, clientFinishedHeaderAndVerify); var serverFinishedHeader = txtServerFinishedHeader.Text.FromWireshark(); md5Handshake = Hasher.ComputeMD5(serverHandshakeMessages); sha1Handshake = Hasher.ComputeSHA1Hash(serverHandshakeMessages); var serverVerifyData = Prf10.GenerateBytes(masterSecret, txtServerFinishedLabel.Text, ByteUtilities.ConcatBytes(md5Handshake, sha1Handshake), 12); txtServerFinishedVerifyData.Text = serverVerifyData.ToDisplayByteString(); var serverFirstHash = Hasher.ComputeTlsMD5Hmac(server_write_MAC_secret, 0x16, 0, ByteUtilities.ConcatBytes(serverFinishedHeader, serverVerifyData)); txtServerFinishedHmacMd5.Text = serverFirstHash.ToDisplayByteString(); var serverArc4 = new Arc4(server_write_key); var serverFinishedMessage = ByteUtilities.ConcatBytes(serverFinishedHeader, serverVerifyData, serverFirstHash); var encryptedServerFinishedMessage = serverArc4.Encrypt(serverFinishedMessage); Debug.Assert(ByteUtilities.AreEqual(encryptedServerFinishedMessage, txtServerEncryptedHandshakeMessage.Text.FromWireshark())); var serverApplicationDataBytes = txtServerApplicationDataInput.Text.FromWireshark(); var decryptedServerApplicationDataBytes = serverArc4.Encrypt(serverApplicationDataBytes); var serverPlainTextBytes = new byte[decryptedServerApplicationDataBytes.Length - 16]; Buffer.BlockCopy(decryptedServerApplicationDataBytes, 0, serverPlainTextBytes, 0, serverPlainTextBytes.Length); var hmacServerFirstPacketReceived = new byte[16]; Buffer.BlockCopy(decryptedServerApplicationDataBytes, serverPlainTextBytes.Length, hmacServerFirstPacketReceived, 0, 16); txtDecryptedServerApplicationData.Text = ASCIIEncoding.ASCII.GetString(serverPlainTextBytes); var hmacServerFirstPacketComputed = Hasher.ComputeTlsMD5Hmac(server_write_MAC_secret, 23, 1, serverPlainTextBytes); txtServerApplicationDataHmac.Text = hmacServerFirstPacketComputed.ToDisplayByteString(); Debug.Assert(ByteUtilities.AreEqual(hmacServerFirstPacketComputed, hmacServerFirstPacketComputed)); } catch (Exception ex) { MessageBox.Show("Error calculating derived handshake info: " + ex.Message); } } private void btnPrfGenerate_Click(object sender, EventArgs e) { try { byte[] secretBytes = txtPrfSecretBytes.Text.FromWireshark(); string prfLabel = txtPrfLabel.Text; byte[] seedBytes = txtPrfSeedBytes.Text.FromWireshark(); int bytesToGenerate = (int)nudBytesToGenerate.Value; txtPrfAsciiLabelBytes.Text = prfLabel.ToAsciiBytes().ToDisplayByteString(); byte[] prfBytes = Prf10.GenerateBytes(secretBytes, prfLabel, seedBytes, bytesToGenerate); txtPrfOutput.Text = prfBytes.ToDisplayByteString(); txtPrfMD5Output.Text = Hasher.ComputeMD5(prfBytes).ToDisplayByteString(); } catch (Exception ex) { MessageBox.Show("Error generating PRF: " + ex.Message); } } private void btnGenerateHmac_Click(object sender, EventArgs e) { try { byte[] keyBytes = txtHmacKeyString.Text.ToAsciiBytes(); txtHmacKeyAsciiBytes.Text = keyBytes.ToDisplayByteString(); byte[] dataBytes = txtHmacDataString.Text.ToAsciiBytes(); txtHmacDataAsciiBytes.Text = dataBytes.ToDisplayByteString(); const int blockSize = 64; Func getPad = padByte => Enumerable.Range(1, blockSize).Select(n=>padByte).ToArray(); // SHA-1 byte[] sha1Key = keyBytes.Length > blockSize ? Hasher.ComputeSHA1Hash(keyBytes) : keyBytes; byte[] sha1Opad = getPad(0x5c); txtHmacSha1Opad.Text = sha1Opad.ToDisplayByteString(); byte[] sha1KeyXorOpad = sha1Key.Xor(sha1Opad); txtHmacSha1KeyXorOpad.Text = sha1KeyXorOpad.ToDisplayByteString(); byte[] sha1Ipad = getPad(0x36); txtHmacSha1IpadBytes.Text = sha1Ipad.ToDisplayByteString(); byte[] sha1KeyXorIpad = sha1Key.Xor(sha1Ipad); txtHmacSha1KeyXorIpad.Text = sha1KeyXorIpad.ToDisplayByteString(); byte[] sha1TotalInnerToHash = ByteUtilities.ConcatBytes(sha1KeyXorIpad, dataBytes); byte[] sha1InnerHash = Hasher.ComputeSHA1Hash(sha1TotalInnerToHash); txtHmacSha1InnerHash.Text = sha1InnerHash.ToDisplayByteString(); byte[] sha1Hmac = Hasher.ComputeSHA1Hash(ByteUtilities.ConcatBytes(sha1KeyXorOpad, sha1InnerHash)); byte[] sha1ExpectedHmac = Hasher.ComputeSHA1Hmac(keyBytes, dataBytes); Debug.Assert(ByteUtilities.AreEqual(sha1ExpectedHmac, sha1Hmac)); txtHmacSha1Result.Text = sha1Hmac.ToDisplayByteString(); // MD5 byte[] md5Key = keyBytes.Length > blockSize ? Hasher.ComputeMD5(keyBytes) : keyBytes; byte[] md5Opad = getPad(0x5c); txtHmacMd5Opad.Text = md5Opad.ToDisplayByteString(); byte[] md5KeyXorOpad = md5Key.Xor(md5Opad); txtHmacMd5KeyXorOpad.Text = md5KeyXorOpad.ToDisplayByteString(); byte[] md5Ipad = getPad(0x36); txtHmacMd5IpadBytes.Text = md5Ipad.ToDisplayByteString(); byte[] md5KeyXorIpad = md5Key.Xor(md5Ipad); txtHmacMd5KeyXorIpad.Text = md5KeyXorIpad.ToDisplayByteString(); byte[] md5TotalInnerToHash = ByteUtilities.ConcatBytes(md5KeyXorIpad, dataBytes); byte[] md5InnerHash = Hasher.ComputeMD5(md5TotalInnerToHash); txtHmacMd5InnerHash.Text = md5InnerHash.ToDisplayByteString(); byte[] md5Hmac = Hasher.ComputeMD5(ByteUtilities.ConcatBytes(md5KeyXorOpad, md5InnerHash)); byte[] md5ExpectedHmac = Hasher.ComputeMD5Hmac(keyBytes, dataBytes); Debug.Assert(ByteUtilities.AreEqual(md5ExpectedHmac, md5Hmac)); txtHmacMd5Result.Text = md5Hmac.ToDisplayByteString(); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } } private void btnCalculateCertificateInformation_Click(object sender, EventArgs e) { try { // Get moduli ahead of time since they'll be needed in a chained fashion byte[] amazonModulusBytes = txtAmazonModulus.Text.FromWireshark(); BigInteger amazonModulus = new BigInteger(amazonModulusBytes); txtAmazonModulusBase10.Text = amazonModulus.ToDisplayString(); byte[] amazonPublicExponentBytes = txtAmazonPublicExponent.Text.FromWireshark(); byte[] verisignClass3SecureServerModulusBytes = txtVerisignClass3SecureServerModulus.Text.FromWireshark(); BigInteger verisignClass3SecureServerModulus = new BigInteger(verisignClass3SecureServerModulusBytes); txtVerisignClass3SecureServerModulusBase10.Text = verisignClass3SecureServerModulus.ToDisplayString(); byte[] verisignClass3SecureServerPublicExponentBytes = txtVerisignClass3SecureServerPublicExponent.Text.FromWireshark(); byte[] verisignClass3PrimaryCertificationAuthorityModulusBytes = txtVerisignClass3PrimaryCertificationAuthorityModulus.Text.FromWireshark(); BigInteger verisignClass3PrimaryCertificationAuthorityModulus = new BigInteger(verisignClass3PrimaryCertificationAuthorityModulusBytes); txtVerisignClass3PrimaryCertificationAuthorityModulusBase10.Text = verisignClass3PrimaryCertificationAuthorityModulus.ToDisplayString(); byte[] verisignClass3PrimaryCertificationAuthorityPublicExponentBytes = txtVerisignClass3PrimaryCertificationAuthorityPublicExponent.Text.FromWireshark(); byte[] amazonSignedCertificateBytes = txtAmazonSignatureValue.Text.FromWireshark(); byte[] amazonDecryptedSignatureBytes = RsaUtilities.GetSignedOriginalValue(amazonSignedCertificateBytes, verisignClass3SecureServerPublicExponentBytes, verisignClass3SecureServerModulusBytes); txtAmazonDecryptedSignature.Text = amazonDecryptedSignatureBytes.ToDisplayByteString(16); const int sha1HashSize = 20; // bytes byte[] amazonHashValueBytes = amazonDecryptedSignatureBytes.SubBytes(amazonDecryptedSignatureBytes.Length - sha1HashSize); Debug.Assert(ByteUtilities.AreEqual(Hasher.ComputeSHA1Hash(txtAmazonSignedCertificate.Text.FromWireshark()), amazonHashValueBytes)); txtAmazonHashValue.Text = amazonHashValueBytes.ToDisplayByteString(); // For algorithm info, see http://tools.ietf.org/html/rfc3447#page-43 const int algorithmIdSize = 15; // bytes byte[] amazonAlgorithmIdBytes = amazonDecryptedSignatureBytes.SubBytes(amazonDecryptedSignatureBytes.Length - sha1HashSize - algorithmIdSize, algorithmIdSize); txtAmazonHashAlgorithmId.Text = amazonAlgorithmIdBytes.ToDisplayByteString(); byte[] verisignClass3SecureServerSignatureValueBytes = txtVerisignClass3SecureServerSignatureValue.Text.FromWireshark(); byte[] verisignClass3SecureServerDecryptedSignatureBytes = RsaUtilities.GetSignedOriginalValue(verisignClass3SecureServerSignatureValueBytes, verisignClass3PrimaryCertificationAuthorityPublicExponentBytes, verisignClass3PrimaryCertificationAuthorityModulusBytes); txtVerisignClass3SecureServerDecryptedSignature.Text = verisignClass3SecureServerDecryptedSignatureBytes.ToDisplayByteString(16); byte[] verisignClass3SecureServerHashValueBytes = verisignClass3SecureServerDecryptedSignatureBytes.SubBytes(verisignClass3SecureServerDecryptedSignatureBytes.Length - sha1HashSize); Debug.Assert(ByteUtilities.AreEqual(Hasher.ComputeSHA1Hash(txtVersignClass3SecureServerSignedCertificate.Text.FromWireshark()), verisignClass3SecureServerHashValueBytes)); txtVerisignClass3SecureServerHashValue.Text = verisignClass3SecureServerHashValueBytes.ToDisplayByteString(); byte[] verisignClass3SecureServerAlgorithmIdBytes = verisignClass3SecureServerDecryptedSignatureBytes.SubBytes(verisignClass3SecureServerDecryptedSignatureBytes.Length - sha1HashSize - algorithmIdSize, algorithmIdSize); txtVerisignClass3SecureServerHashAlgorithmId.Text = verisignClass3SecureServerAlgorithmIdBytes.ToDisplayByteString(); byte[] verisignClass3PrimaryCertificationAuthoritySignatureValueBytes = txtVerisignClass3PrimaryCertificationAuthoritySignatureValue.Text.FromWireshark(); byte[] verisignClass3PrimaryCertificationAuthorityDecryptedSignatureBytes = RsaUtilities.GetSignedOriginalValue(verisignClass3PrimaryCertificationAuthoritySignatureValueBytes, verisignClass3PrimaryCertificationAuthorityPublicExponentBytes, verisignClass3PrimaryCertificationAuthorityModulusBytes); txtVerisignClass3PrimaryCertificationAuthorityDecryptedSignature.Text = verisignClass3PrimaryCertificationAuthorityDecryptedSignatureBytes.ToDisplayByteString(16); const int md2HashSize = 16; // bytes int md2AlgorithmIdSize = algorithmIdSize + 3; byte[] verisignClass3PrimaryCertificationAuthorityHashValueBytes = verisignClass3SecureServerDecryptedSignatureBytes.SubBytes(verisignClass3SecureServerDecryptedSignatureBytes.Length - md2HashSize); txtVerisignClass3PrimaryCertificationAuthorityHashValue.Text = verisignClass3PrimaryCertificationAuthorityHashValueBytes.ToDisplayByteString(); byte[] verisignClass3PrimaryCertificationAuthorityAlgorithmIdBytes = verisignClass3PrimaryCertificationAuthorityDecryptedSignatureBytes.SubBytes(verisignClass3PrimaryCertificationAuthorityDecryptedSignatureBytes.Length - md2HashSize - md2AlgorithmIdSize, md2AlgorithmIdSize); txtVerisignClass3PrimaryCertificationAuthorityHashAlgorithmId.Text = verisignClass3PrimaryCertificationAuthorityAlgorithmIdBytes.ToDisplayByteString(); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } } } } ================================================ FILE: MainForm.resx ================================================ text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 c95c599ef21b8a0114b410df0440dbe357af6a45408f840c0bd133d9d911cfee02581f25f72aa84405aaec031f787f9e93b99a00aa237dd6ac85a26345c77227ccf44cc67571d239ef4f42f075df0a90c68e206f980ff8ac235f702936a4c986e7b19a20cb53a585e73dbe7d9afe244533dc7615ed0fa271644c652e816845a7 bb4c122bcf2c26004f1413dda6fbfc0a11848cf3281c67922f7cb6c5fadff0e895bc1d8f6c2ca851cc73d8a4c053f04ed626c076015781925e21f1d1b1ffe7d02158cd6917e3441c9c194439895cdc9c000f568d0299eda290454ce4bb10a43df032030ef1cef8e8c9518ce6629fe69fc07db7729cc9363a6b9f4ea8ff640d64 30820405a003020102021075337d9ab0e1233bae2d7de4469162d4300d06092a864886f70d0101050500305f310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e31373035060355040b132e436c6173732033205075626c6963205072696d6172792043657274696669636174696f6e20417574686f72697479301e170d3035303131393030303030305a170d3135303131383233353935395a3081b0310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e311f301d060355040b1316566572695369676e205472757374204e6574776f726b313b3039060355040b13325465726d73206f66207573652061742068747470733a2f2f7777772e766572697369676e2e636f6d2f727061202863293035312a302806035504031321566572695369676e20436c6173732033205365637572652053657276657220434130820122300d06092a864886f70d01010105000382010f003082010a028201010095c321128e40c50d015f765e6694d9732c581922b8c9fc7a39902a77727c1d3ef7d855e3af42cb873002dc5bac70e6b844b42b35eb93d217057ecb46d65c53a032519d746458f90c9a00ea5e44496472f4cd10e2850af934eeb38866a9a5a45ad00e987f580d2b52bb86a97e2efab2487c8ddb2d5f0175a28d063b8bb46107c9be2299f81bd1b55766044d35f4917196b59908259b97c83af320b1dd9e980c4a63b7a6ceb001cef8936af30c6e9fb1e9847b819841e681dc3d2ce7b46be39efc0816d7b3d5b96612997c6d71c84dbec70fe3fb37add57587216b86d044145a547939966956c9b931cd896158e1d9760505adf7b902afa7fd4791a222345a31d10203010001a38201813082017d30120603551d130101ff040830060101ff02010030440603551d20043d303b3039060b6086480186f84501071703302a302806082b06010505070201161c68747470733a2f2f7777772e766572697369676e2e636f6d2f72706130310603551d1f042a30283026a024a0228620687474703a2f2f63726c2e766572697369676e2e636f6d2f706361332e63726c300e0603551d0f0101ff040403020106301106096086480186f842010104040302010630290603551d1104223020a41e301c311a301806035504031311436c617373334341323034382d312d3435301d0603551d0e041604146fecafa0dd8aa4eff52a10672d3f5582bcd7ef253081800603551d2304793077a163a461305f310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e31373035060355040b132e436c6173732033205075626c6963205072696d6172792043657274696669636174696f6e20417574686f72697479821070bae41d10d92934b638ca7b03ccbabf 95c321128e40c50d015f765e6694d9732c581922b8c9fc7a39902a77727c1d3ef7d855e3af42cb873002dc5bac70e6b844b42b35eb93d217057ecb46d65c53a032519d746458f90c9a00ea5e44496472f4cd10e2850af934eeb38866a9a5a45ad00e987f580d2b52bb86a97e2efab2487c8ddb2d5f0175a28d063b8bb46107c9be2299f81bd1b55766044d35f4917196b59908259b97c83af320b1dd9e980c4a63b7a6ceb001cef8936af30c6e9fb1e9847b819841e681dc3d2ce7b46be39efc0816d7b3d5b96612997c6d71c84dbec7 0fe3fb37add57587216b86d044145a547939966956c9b931cd896158e1d9760505adf7b902afa7fd4791a222345a31d1 c37e08465d9136cf67dcd7a7afafb822c38b0474d3b160bce6feb74412815b3173146356c6722ed11a03435c380a504a4dcddab619a8f4990dafe3f7d8f1752865f66afe9bf4bd52d93fcbda16cba59e2e8e6652783d26fafe9436884a955e2a4c19ef6efa823f2d03efd628b33718cf42b234216447d3206b3a4cdce603900c c5176d5880046305c91466c7b7f2ed05d6f3f528212f0e829c86dbf35981cd6f5c669aff9e2d93738e795a347501aa7bb90379fc085405827744914d160f2f3ade9a793413eba875e323e5a82ba577b45d0908be25ccd5fd44916971f9a772533d7edffcf7cc84241cc803cd8e5764ea121169c988670e1c28550351a58b2adb 3feb3eff141d141d684f6d0c571d2c05e0df6161174a949272d043c6d5f20172193abba420fda6f193312c6d8b91ad6a41c993b2f99cf680d3767049d067447c4b43864f91e2c3c2f6f0703f7d3044e77ec83058ce81634773cdcb019301e9189cba318316a793b5f9f5230ff832d2d661f7c05587666cd757052ce5967ec836743aa68b526903d09db325bb8547892d5c924ae3ff3fa9a854d4d84a9b7af7a8cd8237db964c843a876b8385d955d64fcb2aacf40b15e8a06e0491c3bc6892a420d828af09738ff492fc23b9c521d7cff6175fba59cbd0cdd5b9f99876fad5fa98904a2338330336d66906cd196f8b8b173070aef1d14f8c18c38fefc3286673 308203dba0030201020210169d041c3130be3d566606f2679ba172300d06092a864886f70d01010505003081b0310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e311f301d060355040b1316566572695369676e205472757374204e6574776f726b313b3039060355040b13325465726d73206f66207573652061742068747470733a2f2f7777772e766572697369676e2e636f6d2f727061202863293035312a302806035504031321566572695369676e20436c61737320332053656375726520536572766572204341301e170d3038303832373030303030305a170d3039303832373233353935395a3067310b3009060355040613025553311330110603550408130a57617368696e67746f6e3110300e0603550407140753656174746c6531183016060355040a140f416d617a6f6e2e636f6d20496e632e311730150603550403140e7777772e616d617a6f6e2e636f6d30819f300d06092a864886f70d010101050003818d0030818902818100c5176d5880046305c91466c7b7f2ed05d6f3f528212f0e829c86dbf35981cd6f5c669aff9e2d93738e795a347501aa7bb90379fc085405827744914d160f2f3ade9a793413eba875e323e5a82ba577b45d0908be25ccd5fd44916971f9a772533d7edffcf7cc84241cc803cd8e5764ea121169c988670e1c28550351a58b2adb0203010001a38201d3308201cf30090603551d1304023000300b0603551d0f0404030205a030440603551d1f043d303b3039a037a0358633687474703a2f2f5356525365637572652d63726c2e766572697369676e2e636f6d2f535652536563757265323030352e63726c30440603551d20043d303b3039060b6086480186f84501071703302a302806082b06010505070201161c68747470733a2f2f7777772e766572697369676e2e636f6d2f727061301d0603551d250416301406082b0601050507030106082b06010505070302301f0603551d230418301680146fecafa0dd8aa4eff52a10672d3f5582bcd7ef25307906082b06010505070101046d306b302406082b060105050730018618687474703a2f2f6f6373702e766572697369676e2e636f6d304306082b060105050730028637687474703a2f2f5356525365637572652d6169612e766572697369676e2e636f6d2f535652536563757265323030352d6169612e636572306e06082b0601050507010c04623060a15ea05c305a305830561609696d6167652f6769663021301f300706052b0e03021a04144b6bb92896060cbbd052389b29ac4b078b21051830261624687474703a2f2f6c6f676f2e766572697369676e2e636f6d2f76736c6f676f312e676966 ================================================ FILE: Mono/BigInteger.cs ================================================ // // BigInteger.cs - Big Integer implementation // // Authors: // Ben Maurer // Chew Keong TAN // Sebastien Pouliot // Pieter Philippaerts // // Copyright (c) 2003 Ben Maurer // All rights reserved // // Copyright (c) 2002 Chew Keong TAN // All rights reserved. // // Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Security.Cryptography; using Mono.Math.Prime.Generator; using Mono.Math.Prime; namespace Mono.Math { #if INSIDE_CORLIB internal #else public #endif class BigInteger { #region Data Storage /// /// The Length of this BigInteger /// uint length = 1; /// /// The data for this BigInteger /// uint [] data; #endregion #region Constants /// /// Default length of a BigInteger in bytes /// const uint DEFAULT_LEN = 20; /// /// Table of primes below 2000. /// /// /// /// This table was generated using Mathematica 4.1 using the following function: /// /// /// /// PrimeTable [x_] := Prime [Range [1, PrimePi [x]]] /// PrimeTable [6000] /// /// /// internal static readonly uint [] smallPrimes = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987 }; public enum Sign : int { Negative = -1, Zero = 0, Positive = 1 }; #region Exception Messages const string WouldReturnNegVal = "Operation would return a negative value"; #endregion #endregion #region Constructors public BigInteger () { data = new uint [DEFAULT_LEN]; this.length = DEFAULT_LEN; } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public BigInteger (Sign sign, uint len) { this.data = new uint [len]; this.length = len; } public BigInteger (BigInteger bi) { this.data = (uint [])bi.data.Clone (); this.length = bi.length; } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public BigInteger (BigInteger bi, uint len) { this.data = new uint [len]; for (uint i = 0; i < bi.length; i++) this.data [i] = bi.data [i]; this.length = bi.length; } #endregion #region Conversions public BigInteger (byte [] inData) { length = (uint)inData.Length >> 2; int leftOver = inData.Length & 0x3; // length not multiples of 4 if (leftOver != 0) length++; data = new uint [length]; for (int i = inData.Length - 1, j = 0; i >= 3; i -= 4, j++) { data [j] = (uint)( (inData [i-3] << (3*8)) | (inData [i-2] << (2*8)) | (inData [i-1] << (1*8)) | (inData [i]) ); } switch (leftOver) { case 1: data [length-1] = (uint)inData [0]; break; case 2: data [length-1] = (uint)((inData [0] << 8) | inData [1]); break; case 3: data [length-1] = (uint)((inData [0] << 16) | (inData [1] << 8) | inData [2]); break; } this.Normalize (); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public BigInteger (uint [] inData) { length = (uint)inData.Length; data = new uint [length]; for (int i = (int)length - 1, j = 0; i >= 0; i--, j++) data [j] = inData [i]; this.Normalize (); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public BigInteger (uint ui) { data = new uint [] {ui}; } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public BigInteger (ulong ul) { data = new uint [2] { (uint)ul, (uint)(ul >> 32)}; length = 2; this.Normalize (); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public static implicit operator BigInteger (uint value) { return (new BigInteger (value)); } public static implicit operator BigInteger (int value) { if (value < 0) throw new ArgumentOutOfRangeException ("value"); return (new BigInteger ((uint)value)); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public static implicit operator BigInteger (ulong value) { return (new BigInteger (value)); } /* This is the BigInteger.Parse method I use. This method works because BigInteger.ToString returns the input I gave to Parse. */ public static BigInteger Parse (string number) { if (number == null) throw new ArgumentNullException ("number"); int i = 0, len = number.Length; char c; bool digits_seen = false; BigInteger val = new BigInteger (0); if (number [i] == '+') { i++; } else if (number [i] == '-') { throw new FormatException (WouldReturnNegVal); } for (; i < len; i++) { c = number [i]; if (c == '\0') { i = len; continue; } if (c >= '0' && c <= '9') { val = val * 10 + (c - '0'); digits_seen = true; } else { if (Char.IsWhiteSpace (c)) { for (i++; i < len; i++) { if (!Char.IsWhiteSpace (number [i])) throw new FormatException (); } break; } else throw new FormatException (); } } if (!digits_seen) throw new FormatException (); return val; } #endregion #region Operators public static BigInteger operator + (BigInteger bi1, BigInteger bi2) { if (bi1 == 0) return new BigInteger (bi2); else if (bi2 == 0) return new BigInteger (bi1); else return Kernel.AddSameSign (bi1, bi2); } public static BigInteger operator - (BigInteger bi1, BigInteger bi2) { if (bi2 == 0) return new BigInteger (bi1); if (bi1 == 0) throw new ArithmeticException (WouldReturnNegVal); switch (Kernel.Compare (bi1, bi2)) { case Sign.Zero: return 0; case Sign.Positive: return Kernel.Subtract (bi1, bi2); case Sign.Negative: throw new ArithmeticException (WouldReturnNegVal); default: throw new Exception (); } } public static int operator % (BigInteger bi, int i) { if (i > 0) return (int)Kernel.DwordMod (bi, (uint)i); else return -(int)Kernel.DwordMod (bi, (uint)-i); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public static uint operator % (BigInteger bi, uint ui) { return Kernel.DwordMod (bi, (uint)ui); } public static BigInteger operator % (BigInteger bi1, BigInteger bi2) { return Kernel.multiByteDivide (bi1, bi2)[1]; } public static BigInteger operator / (BigInteger bi, int i) { if (i > 0) return Kernel.DwordDiv (bi, (uint)i); throw new ArithmeticException (WouldReturnNegVal); } public static BigInteger operator / (BigInteger bi1, BigInteger bi2) { return Kernel.multiByteDivide (bi1, bi2)[0]; } public static BigInteger operator * (BigInteger bi1, BigInteger bi2) { if (bi1 == 0 || bi2 == 0) return 0; // // Validate pointers // if (bi1.data.Length < bi1.length) throw new IndexOutOfRangeException ("bi1 out of range"); if (bi2.data.Length < bi2.length) throw new IndexOutOfRangeException ("bi2 out of range"); BigInteger ret = new BigInteger (Sign.Positive, bi1.length + bi2.length); Kernel.Multiply (bi1.data, 0, bi1.length, bi2.data, 0, bi2.length, ret.data, 0); ret.Normalize (); return ret; } public static BigInteger operator * (BigInteger bi, int i) { if (i < 0) throw new ArithmeticException (WouldReturnNegVal); if (i == 0) return 0; if (i == 1) return new BigInteger (bi); return Kernel.MultiplyByDword (bi, (uint)i); } public static BigInteger operator << (BigInteger bi1, int shiftVal) { return Kernel.LeftShift (bi1, shiftVal); } public static BigInteger operator >> (BigInteger bi1, int shiftVal) { return Kernel.RightShift (bi1, shiftVal); } #endregion #region Friendly names for operators // with names suggested by FxCop 1.30 public static BigInteger Add (BigInteger bi1, BigInteger bi2) { return (bi1 + bi2); } public static BigInteger Subtract (BigInteger bi1, BigInteger bi2) { return (bi1 - bi2); } public static int Modulus (BigInteger bi, int i) { return (bi % i); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public static uint Modulus (BigInteger bi, uint ui) { return (bi % ui); } public static BigInteger Modulus (BigInteger bi1, BigInteger bi2) { return (bi1 % bi2); } public static BigInteger Divid (BigInteger bi, int i) { return (bi / i); } public static BigInteger Divid (BigInteger bi1, BigInteger bi2) { return (bi1 / bi2); } public static BigInteger Multiply (BigInteger bi1, BigInteger bi2) { return (bi1 * bi2); } public static BigInteger Multiply (BigInteger bi, int i) { return (bi * i); } #endregion #region Random private static RandomNumberGenerator rng; private static RandomNumberGenerator Rng { get { if (rng == null) rng = RandomNumberGenerator.Create (); return rng; } } /// /// Generates a new, random BigInteger of the specified length. /// /// The number of bits for the new number. /// A random number generator to use to obtain the bits. /// A random number of the specified length. public static BigInteger GenerateRandom (int bits, RandomNumberGenerator rng) { int dwords = bits >> 5; int remBits = bits & 0x1F; if (remBits != 0) dwords++; BigInteger ret = new BigInteger (Sign.Positive, (uint)dwords + 1); byte [] random = new byte [dwords << 2]; rng.GetBytes (random); Buffer.BlockCopy (random, 0, ret.data, 0, (int)dwords << 2); if (remBits != 0) { uint mask = (uint)(0x01 << (remBits-1)); ret.data [dwords-1] |= mask; mask = (uint)(0xFFFFFFFF >> (32 - remBits)); ret.data [dwords-1] &= mask; } else ret.data [dwords-1] |= 0x80000000; ret.Normalize (); return ret; } /// /// Generates a new, random BigInteger of the specified length using the default RNG crypto service provider. /// /// The number of bits for the new number. /// A random number of the specified length. public static BigInteger GenerateRandom (int bits) { return GenerateRandom (bits, Rng); } /// /// Randomizes the bits in "this" from the specified RNG. /// /// A RNG. public void Randomize (RandomNumberGenerator rng) { if (this == 0) return; int bits = this.BitCount (); int dwords = bits >> 5; int remBits = bits & 0x1F; if (remBits != 0) dwords++; byte [] random = new byte [dwords << 2]; rng.GetBytes (random); Buffer.BlockCopy (random, 0, data, 0, (int)dwords << 2); if (remBits != 0) { uint mask = (uint)(0x01 << (remBits-1)); data [dwords-1] |= mask; mask = (uint)(0xFFFFFFFF >> (32 - remBits)); data [dwords-1] &= mask; } else data [dwords-1] |= 0x80000000; Normalize (); } /// /// Randomizes the bits in "this" from the default RNG. /// public void Randomize () { Randomize (Rng); } #endregion #region Bitwise public int BitCount () { this.Normalize (); uint value = data [length - 1]; uint mask = 0x80000000; uint bits = 32; while (bits > 0 && (value & mask) == 0) { bits--; mask >>= 1; } bits += ((length - 1) << 5); return (int)bits; } /// /// Tests if the specified bit is 1. /// /// The bit to test. The least significant bit is 0. /// True if bitNum is set to 1, else false. #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public bool TestBit (uint bitNum) { uint bytePos = bitNum >> 5; // divide by 32 byte bitPos = (byte)(bitNum & 0x1F); // get the lowest 5 bits uint mask = (uint)1 << bitPos; return ((this.data [bytePos] & mask) != 0); } public bool TestBit (int bitNum) { if (bitNum < 0) throw new IndexOutOfRangeException ("bitNum out of range"); uint bytePos = (uint)bitNum >> 5; // divide by 32 byte bitPos = (byte)(bitNum & 0x1F); // get the lowest 5 bits uint mask = (uint)1 << bitPos; return ((this.data [bytePos] | mask) == this.data [bytePos]); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public void SetBit (uint bitNum) { SetBit (bitNum, true); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public void ClearBit (uint bitNum) { SetBit (bitNum, false); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public void SetBit (uint bitNum, bool value) { uint bytePos = bitNum >> 5; // divide by 32 if (bytePos < this.length) { uint mask = (uint)1 << (int)(bitNum & 0x1F); if (value) this.data [bytePos] |= mask; else this.data [bytePos] &= ~mask; } } public int LowestSetBit () { if (this == 0) return -1; int i = 0; while (!TestBit (i)) i++; return i; } public byte[] GetBytes () { if (this == 0) return new byte [1]; int numBits = BitCount (); int numBytes = numBits >> 3; if ((numBits & 0x7) != 0) numBytes++; byte [] result = new byte [numBytes]; int numBytesInWord = numBytes & 0x3; if (numBytesInWord == 0) numBytesInWord = 4; int pos = 0; for (int i = (int)length - 1; i >= 0; i--) { uint val = data [i]; for (int j = numBytesInWord - 1; j >= 0; j--) { result [pos+j] = (byte)(val & 0xFF); val >>= 8; } pos += numBytesInWord; numBytesInWord = 4; } return result; } #endregion #region Compare #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public static bool operator == (BigInteger bi1, uint ui) { if (bi1.length != 1) bi1.Normalize (); return bi1.length == 1 && bi1.data [0] == ui; } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public static bool operator != (BigInteger bi1, uint ui) { if (bi1.length != 1) bi1.Normalize (); return !(bi1.length == 1 && bi1.data [0] == ui); } public static bool operator == (BigInteger bi1, BigInteger bi2) { // we need to compare with null if ((bi1 as object) == (bi2 as object)) return true; if (null == bi1 || null == bi2) return false; return Kernel.Compare (bi1, bi2) == 0; } public static bool operator != (BigInteger bi1, BigInteger bi2) { // we need to compare with null if ((bi1 as object) == (bi2 as object)) return false; if (null == bi1 || null == bi2) return true; return Kernel.Compare (bi1, bi2) != 0; } public static bool operator > (BigInteger bi1, BigInteger bi2) { return Kernel.Compare (bi1, bi2) > 0; } public static bool operator < (BigInteger bi1, BigInteger bi2) { return Kernel.Compare (bi1, bi2) < 0; } public static bool operator >= (BigInteger bi1, BigInteger bi2) { return Kernel.Compare (bi1, bi2) >= 0; } public static bool operator <= (BigInteger bi1, BigInteger bi2) { return Kernel.Compare (bi1, bi2) <= 0; } public Sign Compare (BigInteger bi) { return Kernel.Compare (this, bi); } #endregion #region Formatting #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public string ToString (uint radix) { return ToString (radix, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"); } #if !INSIDE_CORLIB [CLSCompliant (false)] #endif public string ToString (uint radix, string characterSet) { if (characterSet.Length < radix) throw new ArgumentException ("charSet length less than radix", "characterSet"); if (radix == 1) throw new ArgumentException ("There is no such thing as radix one notation", "radix"); if (this == 0) return "0"; if (this == 1) return "1"; string result = ""; BigInteger a = new BigInteger (this); while (a != 0) { uint rem = Kernel.SingleByteDivideInPlace (a, radix); result = characterSet [(int) rem] + result; } return result; } #endregion #region Misc /// /// Normalizes this by setting the length to the actual number of /// uints used in data and by setting the sign to Sign.Zero if the /// value of this is 0. /// private void Normalize () { // Normalize length while (length > 0 && data [length-1] == 0) length--; // Check for zero if (length == 0) length++; } public void Clear () { for (int i=0; i < length; i++) data [i] = 0x00; } #endregion #region Object Impl public override int GetHashCode () { uint val = 0; for (uint i = 0; i < this.length; i++) val ^= this.data [i]; return (int)val; } public override string ToString () { return ToString (10); } public override bool Equals (object o) { if (o == null) return false; if (o is int) return (int)o >= 0 && this == (uint)o; BigInteger bi = o as BigInteger; if (bi == null) return false; return Kernel.Compare (this, bi) == 0; } #endregion #region Number Theory public BigInteger GCD (BigInteger bi) { return Kernel.gcd (this, bi); } public BigInteger ModInverse (BigInteger modulus) { return Kernel.modInverse (this, modulus); } public BigInteger ModPow (BigInteger exp, BigInteger n) { ModulusRing mr = new ModulusRing (n); return mr.Pow (this, exp); } #endregion #region Prime Testing public bool IsProbablePrime () { // can we use our small-prime table ? if (this <= smallPrimes[smallPrimes.Length - 1]) { for (int p = 0; p < smallPrimes.Length; p++) { if (this == smallPrimes[p]) return true; } // the list is complete, so it's not a prime return false; } // otherwise check if we can divide by one of the small primes for (int p = 0; p < smallPrimes.Length; p++) { if (this % smallPrimes[p] == 0) return false; } // the last step is to confirm the "large" prime with the SPP or Miller-Rabin test return PrimalityTests.Test (this, Prime.ConfidenceFactor.Medium); } #endregion #region Prime Number Generation /// /// Generates the smallest prime >= bi /// /// A BigInteger /// The smallest prime >= bi. More mathematically, if bi is prime: bi, else Prime [PrimePi [bi] + 1]. public static BigInteger NextHighestPrime (BigInteger bi) { NextPrimeFinder npf = new NextPrimeFinder (); return npf.GenerateNewPrime (0, bi); } public static BigInteger GeneratePseudoPrime (int bits) { SequentialSearchPrimeGeneratorBase sspg = new SequentialSearchPrimeGeneratorBase (); return sspg.GenerateNewPrime (bits); } /// /// Increments this by two /// public void Incr2 () { int i = 0; data [0] += 2; // If there was no carry, nothing to do if (data [0] < 2) { // Account for the first carry data [++i]++; // Keep adding until no carry while (data [i++] == 0x0) data [i]++; // See if we increased the data length if (length == (uint)i) length++; } } #endregion #if INSIDE_CORLIB internal #else public #endif sealed class ModulusRing { BigInteger mod, constant; public ModulusRing (BigInteger modulus) { this.mod = modulus; // calculate constant = b^ (2k) / m uint i = mod.length << 1; constant = new BigInteger (Sign.Positive, i + 1); constant.data [i] = 0x00000001; constant = constant / mod; } public void BarrettReduction (BigInteger x) { BigInteger n = mod; uint k = n.length, kPlusOne = k+1, kMinusOne = k-1; // x < mod, so nothing to do. if (x.length < k) return; BigInteger q3; // // Validate pointers // if (x.data.Length < x.length) throw new IndexOutOfRangeException ("x out of range"); // q1 = x / b^ (k-1) // q2 = q1 * constant // q3 = q2 / b^ (k+1), Needs to be accessed with an offset of kPlusOne // TODO: We should the method in HAC p 604 to do this (14.45) q3 = new BigInteger (Sign.Positive, x.length - kMinusOne + constant.length); Kernel.Multiply (x.data, kMinusOne, x.length - kMinusOne, constant.data, 0, constant.length, q3.data, 0); // r1 = x mod b^ (k+1) // i.e. keep the lowest (k+1) words uint lengthToCopy = (x.length > kPlusOne) ? kPlusOne : x.length; x.length = lengthToCopy; x.Normalize (); // r2 = (q3 * n) mod b^ (k+1) // partial multiplication of q3 and n BigInteger r2 = new BigInteger (Sign.Positive, kPlusOne); Kernel.MultiplyMod2p32pmod (q3.data, (int)kPlusOne, (int)q3.length - (int)kPlusOne, n.data, 0, (int)n.length, r2.data, 0, (int)kPlusOne); r2.Normalize (); if (r2 <= x) { Kernel.MinusEq (x, r2); } else { BigInteger val = new BigInteger (Sign.Positive, kPlusOne + 1); val.data [kPlusOne] = 0x00000001; Kernel.MinusEq (val, r2); Kernel.PlusEq (x, val); } while (x >= n) Kernel.MinusEq (x, n); } public BigInteger Multiply (BigInteger a, BigInteger b) { if (a == 0 || b == 0) return 0; if (a > mod) a %= mod; if (b > mod) b %= mod; BigInteger ret = new BigInteger (a * b); BarrettReduction (ret); return ret; } public BigInteger Difference (BigInteger a, BigInteger b) { Sign cmp = Kernel.Compare (a, b); BigInteger diff; switch (cmp) { case Sign.Zero: return 0; case Sign.Positive: diff = a - b; break; case Sign.Negative: diff = b - a; break; default: throw new Exception (); } if (diff >= mod) { if (diff.length >= mod.length << 1) diff %= mod; else BarrettReduction (diff); } if (cmp == Sign.Negative) diff = mod - diff; return diff; } #if true public BigInteger Pow (BigInteger a, BigInteger k) { BigInteger b = new BigInteger (1); if (k == 0) return b; BigInteger A = a; if (k.TestBit (0)) b = a; for (int i = 1; i < k.BitCount (); i++) { A = Multiply (A, A); if (k.TestBit (i)) b = Multiply (A, b); } return b; } #else public BigInteger Pow (BigInteger b, BigInteger exp) { if ((mod.data [0] & 1) == 1) return OddPow (b, exp); else return EvenPow (b, exp); } public BigInteger EvenPow (BigInteger b, BigInteger exp) { BigInteger resultNum = new BigInteger ((BigInteger)1, mod.length << 1); BigInteger tempNum = new BigInteger (b % mod, mod.length << 1); // ensures (tempNum * tempNum) < b^ (2k) uint totalBits = (uint)exp.BitCount (); uint [] wkspace = new uint [mod.length << 1]; // perform squaring and multiply exponentiation for (uint pos = 0; pos < totalBits; pos++) { if (exp.TestBit (pos)) { Array.Clear (wkspace, 0, wkspace.Length); Kernel.Multiply (resultNum.data, 0, resultNum.length, tempNum.data, 0, tempNum.length, wkspace, 0); resultNum.length += tempNum.length; uint [] t = wkspace; wkspace = resultNum.data; resultNum.data = t; BarrettReduction (resultNum); } Kernel.SquarePositive (tempNum, ref wkspace); BarrettReduction (tempNum); if (tempNum == 1) { return resultNum; } } return resultNum; } private BigInteger OddPow (BigInteger b, BigInteger exp) { BigInteger resultNum = new BigInteger (Montgomery.ToMont (1, mod), mod.length << 1); BigInteger tempNum = new BigInteger (Montgomery.ToMont (b, mod), mod.length << 1); // ensures (tempNum * tempNum) < b^ (2k) uint mPrime = Montgomery.Inverse (mod.data [0]); uint totalBits = (uint)exp.BitCount (); uint [] wkspace = new uint [mod.length << 1]; // perform squaring and multiply exponentiation for (uint pos = 0; pos < totalBits; pos++) { if (exp.TestBit (pos)) { Array.Clear (wkspace, 0, wkspace.Length); Kernel.Multiply (resultNum.data, 0, resultNum.length, tempNum.data, 0, tempNum.length, wkspace, 0); resultNum.length += tempNum.length; uint [] t = wkspace; wkspace = resultNum.data; resultNum.data = t; Montgomery.Reduce (resultNum, mod, mPrime); } // the value of tempNum is required in the last loop if (pos < totalBits - 1) { Kernel.SquarePositive (tempNum, ref wkspace); Montgomery.Reduce (tempNum, mod, mPrime); } } Montgomery.Reduce (resultNum, mod, mPrime); return resultNum; } #endif #region Pow Small Base // TODO: Make tests for this, not really needed b/c prime stuff // checks it, but still would be nice #if !INSIDE_CORLIB [CLSCompliant (false)] #endif #if true public BigInteger Pow (uint b, BigInteger exp) { return Pow (new BigInteger (b), exp); } #else public BigInteger Pow (uint b, BigInteger exp) { // if (b != 2) { if ((mod.data [0] & 1) == 1) return OddPow (b, exp); else return EvenPow (b, exp); /* buggy in some cases (like the well tested primes) } else { if ((mod.data [0] & 1) == 1) return OddModTwoPow (exp); else return EvenModTwoPow (exp); }*/ } private unsafe BigInteger OddPow (uint b, BigInteger exp) { exp.Normalize (); uint [] wkspace = new uint [mod.length << 1 + 1]; BigInteger resultNum = Montgomery.ToMont ((BigInteger)b, this.mod); resultNum = new BigInteger (resultNum, mod.length << 1 +1); uint mPrime = Montgomery.Inverse (mod.data [0]); int bc = exp.BitCount () - 2; uint pos = (bc > 1 ? (uint) bc : 1); // // We know that the first itr will make the val b // do { // // r = r ^ 2 % m // Kernel.SquarePositive (resultNum, ref wkspace); resultNum = Montgomery.Reduce (resultNum, mod, mPrime); if (exp.TestBit (pos)) { // // r = r * b % m // // TODO: Is Unsafe really speeding things up? fixed (uint* u = resultNum.data) { uint i = 0; ulong mc = 0; do { mc += (ulong)u [i] * (ulong)b; u [i] = (uint)mc; mc >>= 32; } while (++i < resultNum.length); if (resultNum.length < mod.length) { if (mc != 0) { u [i] = (uint)mc; resultNum.length++; while (resultNum >= mod) Kernel.MinusEq (resultNum, mod); } } else if (mc != 0) { // // First, we estimate the quotient by dividing // the first part of each of the numbers. Then // we correct this, if necessary, with a subtraction. // uint cc = (uint)mc; // We would rather have this estimate overshoot, // so we add one to the divisor uint divEstimate; if (mod.data [mod.length - 1] < UInt32.MaxValue) { divEstimate = (uint) ((((ulong)cc << 32) | (ulong) u [i -1]) / (mod.data [mod.length-1] + 1)); } else { // guess but don't divide by 0 divEstimate = (uint) ((((ulong)cc << 32) | (ulong) u [i -1]) / (mod.data [mod.length-1])); } uint t; i = 0; mc = 0; do { mc += (ulong)mod.data [i] * (ulong)divEstimate; t = u [i]; u [i] -= (uint)mc; mc >>= 32; if (u [i] > t) mc++; i++; } while (i < resultNum.length); cc -= (uint)mc; if (cc != 0) { uint sc = 0, j = 0; uint [] s = mod.data; do { uint a = s [j]; if (((a += sc) < sc) | ((u [j] -= a) > ~a)) sc = 1; else sc = 0; j++; } while (j < resultNum.length); cc -= sc; } while (resultNum >= mod) Kernel.MinusEq (resultNum, mod); } else { while (resultNum >= mod) Kernel.MinusEq (resultNum, mod); } } } } while (pos-- > 0); resultNum = Montgomery.Reduce (resultNum, mod, mPrime); return resultNum; } private unsafe BigInteger EvenPow (uint b, BigInteger exp) { exp.Normalize (); uint [] wkspace = new uint [mod.length << 1 + 1]; BigInteger resultNum = new BigInteger ((BigInteger)b, mod.length << 1 + 1); uint pos = (uint)exp.BitCount () - 2; // // We know that the first itr will make the val b // do { // // r = r ^ 2 % m // Kernel.SquarePositive (resultNum, ref wkspace); if (!(resultNum.length < mod.length)) BarrettReduction (resultNum); if (exp.TestBit (pos)) { // // r = r * b % m // // TODO: Is Unsafe really speeding things up? fixed (uint* u = resultNum.data) { uint i = 0; ulong mc = 0; do { mc += (ulong)u [i] * (ulong)b; u [i] = (uint)mc; mc >>= 32; } while (++i < resultNum.length); if (resultNum.length < mod.length) { if (mc != 0) { u [i] = (uint)mc; resultNum.length++; while (resultNum >= mod) Kernel.MinusEq (resultNum, mod); } } else if (mc != 0) { // // First, we estimate the quotient by dividing // the first part of each of the numbers. Then // we correct this, if necessary, with a subtraction. // uint cc = (uint)mc; // We would rather have this estimate overshoot, // so we add one to the divisor uint divEstimate = (uint) ((((ulong)cc << 32) | (ulong) u [i -1]) / (mod.data [mod.length-1] + 1)); uint t; i = 0; mc = 0; do { mc += (ulong)mod.data [i] * (ulong)divEstimate; t = u [i]; u [i] -= (uint)mc; mc >>= 32; if (u [i] > t) mc++; i++; } while (i < resultNum.length); cc -= (uint)mc; if (cc != 0) { uint sc = 0, j = 0; uint [] s = mod.data; do { uint a = s [j]; if (((a += sc) < sc) | ((u [j] -= a) > ~a)) sc = 1; else sc = 0; j++; } while (j < resultNum.length); cc -= sc; } while (resultNum >= mod) Kernel.MinusEq (resultNum, mod); } else { while (resultNum >= mod) Kernel.MinusEq (resultNum, mod); } } } } while (pos-- > 0); return resultNum; } #endif /* known to be buggy in some cases */ #if false private unsafe BigInteger EvenModTwoPow (BigInteger exp) { exp.Normalize (); uint [] wkspace = new uint [mod.length << 1 + 1]; BigInteger resultNum = new BigInteger (2, mod.length << 1 +1); uint value = exp.data [exp.length - 1]; uint mask = 0x80000000; // Find the first bit of the exponent while ((value & mask) == 0) mask >>= 1; // // We know that the first itr will make the val 2, // so eat one bit of the exponent // mask >>= 1; uint wPos = exp.length - 1; do { value = exp.data [wPos]; do { Kernel.SquarePositive (resultNum, ref wkspace); if (resultNum.length >= mod.length) BarrettReduction (resultNum); if ((value & mask) != 0) { // // resultNum = (resultNum * 2) % mod // fixed (uint* u = resultNum.data) { // // Double // uint* uu = u; uint* uuE = u + resultNum.length; uint x, carry = 0; while (uu < uuE) { x = *uu; *uu = (x << 1) | carry; carry = x >> (32 - 1); uu++; } // subtraction inlined because we know it is square if (carry != 0 || resultNum >= mod) { uu = u; uint c = 0; uint [] s = mod.data; uint i = 0; do { uint a = s [i]; if (((a += c) < c) | ((* (uu++) -= a) > ~a)) c = 1; else c = 0; i++; } while (uu < uuE); } } } } while ((mask >>= 1) > 0); mask = 0x80000000; } while (wPos-- > 0); return resultNum; } private unsafe BigInteger OddModTwoPow (BigInteger exp) { uint [] wkspace = new uint [mod.length << 1 + 1]; BigInteger resultNum = Montgomery.ToMont ((BigInteger)2, this.mod); resultNum = new BigInteger (resultNum, mod.length << 1 +1); uint mPrime = Montgomery.Inverse (mod.data [0]); // // TODO: eat small bits, the ones we can do with no modular reduction // uint pos = (uint)exp.BitCount () - 2; do { Kernel.SquarePositive (resultNum, ref wkspace); resultNum = Montgomery.Reduce (resultNum, mod, mPrime); if (exp.TestBit (pos)) { // // resultNum = (resultNum * 2) % mod // fixed (uint* u = resultNum.data) { // // Double // uint* uu = u; uint* uuE = u + resultNum.length; uint x, carry = 0; while (uu < uuE) { x = *uu; *uu = (x << 1) | carry; carry = x >> (32 - 1); uu++; } // subtraction inlined because we know it is square if (carry != 0 || resultNum >= mod) { fixed (uint* s = mod.data) { uu = u; uint c = 0; uint* ss = s; do { uint a = *ss++; if (((a += c) < c) | ((* (uu++) -= a) > ~a)) c = 1; else c = 0; } while (uu < uuE); } } } } } while (pos-- > 0); resultNum = Montgomery.Reduce (resultNum, mod, mPrime); return resultNum; } #endif #endregion } internal sealed class Montgomery { private Montgomery () { } public static uint Inverse (uint n) { uint y = n, z; while ((z = n * y) != 1) y *= 2 - z; return (uint)-y; } public static BigInteger ToMont (BigInteger n, BigInteger m) { n.Normalize (); m.Normalize (); n <<= (int)m.length * 32; n %= m; return n; } public static unsafe BigInteger Reduce (BigInteger n, BigInteger m, uint mPrime) { BigInteger A = n; fixed (uint* a = A.data, mm = m.data) { for (uint i = 0; i < m.length; i++) { // The mod here is taken care of by the CPU, // since the multiply will overflow. uint u_i = a [0] * mPrime /* % 2^32 */; // // A += u_i * m; // A >>= 32 // // mP = Position in mod // aSP = the source of bits from a // aDP = destination for bits uint* mP = mm, aSP = a, aDP = a; ulong c = (ulong)u_i * ((ulong)*(mP++)) + *(aSP++); c >>= 32; uint j = 1; // Multiply and add for (; j < m.length; j++) { c += (ulong)u_i * (ulong)*(mP++) + *(aSP++); *(aDP++) = (uint)c; c >>= 32; } // Account for carry // TODO: use a better loop here, we dont need the ulong stuff for (; j < A.length; j++) { c += *(aSP++); *(aDP++) = (uint)c; c >>= 32; if (c == 0) {j++; break;} } // Copy the rest for (; j < A.length; j++) { *(aDP++) = *(aSP++); } *(aDP++) = (uint)c; } while (A.length > 1 && a [A.length-1] == 0) A.length--; } if (A >= m) Kernel.MinusEq (A, m); return A; } #if _NOT_USED_ public static BigInteger Reduce (BigInteger n, BigInteger m) { return Reduce (n, m, Inverse (m.data [0])); } #endif } /// /// Low level functions for the BigInteger /// private sealed class Kernel { #region Addition/Subtraction /// /// Adds two numbers with the same sign. /// /// A BigInteger /// A BigInteger /// bi1 + bi2 public static BigInteger AddSameSign (BigInteger bi1, BigInteger bi2) { uint [] x, y; uint yMax, xMax, i = 0; // x should be bigger if (bi1.length < bi2.length) { x = bi2.data; xMax = bi2.length; y = bi1.data; yMax = bi1.length; } else { x = bi1.data; xMax = bi1.length; y = bi2.data; yMax = bi2.length; } BigInteger result = new BigInteger (Sign.Positive, xMax + 1); uint [] r = result.data; ulong sum = 0; // Add common parts of both numbers do { sum = ((ulong)x [i]) + ((ulong)y [i]) + sum; r [i] = (uint)sum; sum >>= 32; } while (++i < yMax); // Copy remainder of longer number while carry propagation is required bool carry = (sum != 0); if (carry) { if (i < xMax) { do carry = ((r [i] = x [i] + 1) == 0); while (++i < xMax && carry); } if (carry) { r [i] = 1; result.length = ++i; return result; } } // Copy the rest if (i < xMax) { do r [i] = x [i]; while (++i < xMax); } result.Normalize (); return result; } public static BigInteger Subtract (BigInteger big, BigInteger small) { BigInteger result = new BigInteger (Sign.Positive, big.length); uint [] r = result.data, b = big.data, s = small.data; uint i = 0, c = 0; do { uint x = s [i]; if (((x += c) < c) | ((r [i] = b [i] - x) > ~x)) c = 1; else c = 0; } while (++i < small.length); if (i == big.length) goto fixup; if (c == 1) { do r [i] = b [i] - 1; while (b [i++] == 0 && i < big.length); if (i == big.length) goto fixup; } do r [i] = b [i]; while (++i < big.length); fixup: result.Normalize (); return result; } public static void MinusEq (BigInteger big, BigInteger small) { uint [] b = big.data, s = small.data; uint i = 0, c = 0; do { uint x = s [i]; if (((x += c) < c) | ((b [i] -= x) > ~x)) c = 1; else c = 0; } while (++i < small.length); if (i == big.length) goto fixup; if (c == 1) { do b [i]--; while (b [i++] == 0 && i < big.length); } fixup: // Normalize length while (big.length > 0 && big.data [big.length-1] == 0) big.length--; // Check for zero if (big.length == 0) big.length++; } public static void PlusEq (BigInteger bi1, BigInteger bi2) { uint [] x, y; uint yMax, xMax, i = 0; bool flag = false; // x should be bigger if (bi1.length < bi2.length){ flag = true; x = bi2.data; xMax = bi2.length; y = bi1.data; yMax = bi1.length; } else { x = bi1.data; xMax = bi1.length; y = bi2.data; yMax = bi2.length; } uint [] r = bi1.data; ulong sum = 0; // Add common parts of both numbers do { sum += ((ulong)x [i]) + ((ulong)y [i]); r [i] = (uint)sum; sum >>= 32; } while (++i < yMax); // Copy remainder of longer number while carry propagation is required bool carry = (sum != 0); if (carry){ if (i < xMax) { do carry = ((r [i] = x [i] + 1) == 0); while (++i < xMax && carry); } if (carry) { r [i] = 1; bi1.length = ++i; return; } } // Copy the rest if (flag && i < xMax - 1) { do r [i] = x [i]; while (++i < xMax); } bi1.length = xMax + 1; bi1.Normalize (); } #endregion #region Compare /// /// Compares two BigInteger /// /// A BigInteger /// A BigInteger /// The sign of bi1 - bi2 public static Sign Compare (BigInteger bi1, BigInteger bi2) { // // Step 1. Compare the lengths // uint l1 = bi1.length, l2 = bi2.length; while (l1 > 0 && bi1.data [l1-1] == 0) l1--; while (l2 > 0 && bi2.data [l2-1] == 0) l2--; if (l1 == 0 && l2 == 0) return Sign.Zero; // bi1 len < bi2 len if (l1 < l2) return Sign.Negative; // bi1 len > bi2 len else if (l1 > l2) return Sign.Positive; // // Step 2. Compare the bits // uint pos = l1 - 1; while (pos != 0 && bi1.data [pos] == bi2.data [pos]) pos--; if (bi1.data [pos] < bi2.data [pos]) return Sign.Negative; else if (bi1.data [pos] > bi2.data [pos]) return Sign.Positive; else return Sign.Zero; } #endregion #region Division #region Dword /// /// Performs n / d and n % d in one operation. /// /// A BigInteger, upon exit this will hold n / d /// The divisor /// n % d public static uint SingleByteDivideInPlace (BigInteger n, uint d) { ulong r = 0; uint i = n.length; while (i-- > 0) { r <<= 32; r |= n.data [i]; n.data [i] = (uint)(r / d); r %= d; } n.Normalize (); return (uint)r; } public static uint DwordMod (BigInteger n, uint d) { ulong r = 0; uint i = n.length; while (i-- > 0) { r <<= 32; r |= n.data [i]; r %= d; } return (uint)r; } public static BigInteger DwordDiv (BigInteger n, uint d) { BigInteger ret = new BigInteger (Sign.Positive, n.length); ulong r = 0; uint i = n.length; while (i-- > 0) { r <<= 32; r |= n.data [i]; ret.data [i] = (uint)(r / d); r %= d; } ret.Normalize (); return ret; } public static BigInteger [] DwordDivMod (BigInteger n, uint d) { BigInteger ret = new BigInteger (Sign.Positive , n.length); ulong r = 0; uint i = n.length; while (i-- > 0) { r <<= 32; r |= n.data [i]; ret.data [i] = (uint)(r / d); r %= d; } ret.Normalize (); BigInteger rem = (uint)r; return new BigInteger [] {ret, rem}; } #endregion #region BigNum public static BigInteger [] multiByteDivide (BigInteger bi1, BigInteger bi2) { if (Kernel.Compare (bi1, bi2) == Sign.Negative) return new BigInteger [2] { 0, new BigInteger (bi1) }; bi1.Normalize (); bi2.Normalize (); if (bi2.length == 1) return DwordDivMod (bi1, bi2.data [0]); uint remainderLen = bi1.length + 1; int divisorLen = (int)bi2.length + 1; uint mask = 0x80000000; uint val = bi2.data [bi2.length - 1]; int shift = 0; int resultPos = (int)bi1.length - (int)bi2.length; while (mask != 0 && (val & mask) == 0) { shift++; mask >>= 1; } BigInteger quot = new BigInteger (Sign.Positive, bi1.length - bi2.length + 1); BigInteger rem = (bi1 << shift); uint [] remainder = rem.data; bi2 = bi2 << shift; int j = (int)(remainderLen - bi2.length); int pos = (int)remainderLen - 1; uint firstDivisorByte = bi2.data [bi2.length-1]; ulong secondDivisorByte = bi2.data [bi2.length-2]; while (j > 0) { ulong dividend = ((ulong)remainder [pos] << 32) + (ulong)remainder [pos-1]; ulong q_hat = dividend / (ulong)firstDivisorByte; ulong r_hat = dividend % (ulong)firstDivisorByte; do { if (q_hat == 0x100000000 || (q_hat * secondDivisorByte) > ((r_hat << 32) + remainder [pos-2])) { q_hat--; r_hat += (ulong)firstDivisorByte; if (r_hat < 0x100000000) continue; } break; } while (true); // // At this point, q_hat is either exact, or one too large // (more likely to be exact) so, we attempt to multiply the // divisor by q_hat, if we get a borrow, we just subtract // one from q_hat and add the divisor back. // uint t; uint dPos = 0; int nPos = pos - divisorLen + 1; ulong mc = 0; uint uint_q_hat = (uint)q_hat; do { mc += (ulong)bi2.data [dPos] * (ulong)uint_q_hat; t = remainder [nPos]; remainder [nPos] -= (uint)mc; mc >>= 32; if (remainder [nPos] > t) mc++; dPos++; nPos++; } while (dPos < divisorLen); nPos = pos - divisorLen + 1; dPos = 0; // Overestimate if (mc != 0) { uint_q_hat--; ulong sum = 0; do { sum = ((ulong)remainder [nPos]) + ((ulong)bi2.data [dPos]) + sum; remainder [nPos] = (uint)sum; sum >>= 32; dPos++; nPos++; } while (dPos < divisorLen); } quot.data [resultPos--] = (uint)uint_q_hat; pos--; j--; } quot.Normalize (); rem.Normalize (); BigInteger [] ret = new BigInteger [2] { quot, rem }; if (shift != 0) ret [1] >>= shift; return ret; } #endregion #endregion #region Shift public static BigInteger LeftShift (BigInteger bi, int n) { if (n == 0) return new BigInteger (bi, bi.length + 1); int w = n >> 5; n &= ((1 << 5) - 1); BigInteger ret = new BigInteger (Sign.Positive, bi.length + 1 + (uint)w); uint i = 0, l = bi.length; if (n != 0) { uint x, carry = 0; while (i < l) { x = bi.data [i]; ret.data [i + w] = (x << n) | carry; carry = x >> (32 - n); i++; } ret.data [i + w] = carry; } else { while (i < l) { ret.data [i + w] = bi.data [i]; i++; } } ret.Normalize (); return ret; } public static BigInteger RightShift (BigInteger bi, int n) { if (n == 0) return new BigInteger (bi); int w = n >> 5; int s = n & ((1 << 5) - 1); BigInteger ret = new BigInteger (Sign.Positive, bi.length - (uint)w + 1); uint l = (uint)ret.data.Length - 1; if (s != 0) { uint x, carry = 0; while (l-- > 0) { x = bi.data [l + w]; ret.data [l] = (x >> n) | carry; carry = x << (32 - n); } } else { while (l-- > 0) ret.data [l] = bi.data [l + w]; } ret.Normalize (); return ret; } #endregion #region Multiply public static BigInteger MultiplyByDword (BigInteger n, uint f) { BigInteger ret = new BigInteger (Sign.Positive, n.length + 1); uint i = 0; ulong c = 0; do { c += (ulong)n.data [i] * (ulong)f; ret.data [i] = (uint)c; c >>= 32; } while (++i < n.length); ret.data [i] = (uint)c; ret.Normalize (); return ret; } /// /// Multiplies the data in x [xOffset:xOffset+xLen] by /// y [yOffset:yOffset+yLen] and puts it into /// d [dOffset:dOffset+xLen+yLen]. /// /// /// This code is unsafe! It is the caller's responsibility to make /// sure that it is safe to access x [xOffset:xOffset+xLen], /// y [yOffset:yOffset+yLen], and d [dOffset:dOffset+xLen+yLen]. /// public static unsafe void Multiply (uint [] x, uint xOffset, uint xLen, uint [] y, uint yOffset, uint yLen, uint [] d, uint dOffset) { fixed (uint* xx = x, yy = y, dd = d) { uint* xP = xx + xOffset, xE = xP + xLen, yB = yy + yOffset, yE = yB + yLen, dB = dd + dOffset; for (; xP < xE; xP++, dB++) { if (*xP == 0) continue; ulong mcarry = 0; uint* dP = dB; for (uint* yP = yB; yP < yE; yP++, dP++) { mcarry += ((ulong)*xP * (ulong)*yP) + (ulong)*dP; *dP = (uint)mcarry; mcarry >>= 32; } if (mcarry != 0) *dP = (uint)mcarry; } } } /// /// Multiplies the data in x [xOffset:xOffset+xLen] by /// y [yOffset:yOffset+yLen] and puts the low mod words into /// d [dOffset:dOffset+mod]. /// /// /// This code is unsafe! It is the caller's responsibility to make /// sure that it is safe to access x [xOffset:xOffset+xLen], /// y [yOffset:yOffset+yLen], and d [dOffset:dOffset+mod]. /// public static unsafe void MultiplyMod2p32pmod (uint [] x, int xOffset, int xLen, uint [] y, int yOffest, int yLen, uint [] d, int dOffset, int mod) { fixed (uint* xx = x, yy = y, dd = d) { uint* xP = xx + xOffset, xE = xP + xLen, yB = yy + yOffest, yE = yB + yLen, dB = dd + dOffset, dE = dB + mod; for (; xP < xE; xP++, dB++) { if (*xP == 0) continue; ulong mcarry = 0; uint* dP = dB; for (uint* yP = yB; yP < yE && dP < dE; yP++, dP++) { mcarry += ((ulong)*xP * (ulong)*yP) + (ulong)*dP; *dP = (uint)mcarry; mcarry >>= 32; } if (mcarry != 0 && dP < dE) *dP = (uint)mcarry; } } } public static unsafe void SquarePositive (BigInteger bi, ref uint [] wkSpace) { uint [] t = wkSpace; wkSpace = bi.data; uint [] d = bi.data; uint dl = bi.length; bi.data = t; fixed (uint* dd = d, tt = t) { uint* ttE = tt + t.Length; // Clear the dest for (uint* ttt = tt; ttt < ttE; ttt++) *ttt = 0; uint* dP = dd, tP = tt; for (uint i = 0; i < dl; i++, dP++) { if (*dP == 0) continue; ulong mcarry = 0; uint bi1val = *dP; uint* dP2 = dP + 1, tP2 = tP + 2*i + 1; for (uint j = i + 1; j < dl; j++, tP2++, dP2++) { // k = i + j mcarry += ((ulong)bi1val * (ulong)*dP2) + *tP2; *tP2 = (uint)mcarry; mcarry >>= 32; } if (mcarry != 0) *tP2 = (uint)mcarry; } // Double t. Inlined for speed. tP = tt; uint x, carry = 0; while (tP < ttE) { x = *tP; *tP = (x << 1) | carry; carry = x >> (32 - 1); tP++; } if (carry != 0) *tP = carry; // Add in the diagnals dP = dd; tP = tt; for (uint* dE = dP + dl; (dP < dE); dP++, tP++) { ulong val = (ulong)*dP * (ulong)*dP + *tP; *tP = (uint)val; val >>= 32; *(++tP) += (uint)val; if (*tP < (uint)val) { uint* tP3 = tP; // Account for the first carry (*++tP3)++; // Keep adding until no carry while ((*tP3++) == 0) (*tP3)++; } } bi.length <<= 1; // Normalize length while (tt [bi.length-1] == 0 && bi.length > 1) bi.length--; } } /* * Never called in BigInteger (and part of a private class) * public static bool Double (uint [] u, int l) { uint x, carry = 0; uint i = 0; while (i < l) { x = u [i]; u [i] = (x << 1) | carry; carry = x >> (32 - 1); i++; } if (carry != 0) u [l] = carry; return carry != 0; }*/ #endregion #region Number Theory public static BigInteger gcd (BigInteger a, BigInteger b) { BigInteger x = a; BigInteger y = b; BigInteger g = y; while (x.length > 1) { g = x; x = y % x; y = g; } if (x == 0) return g; // TODO: should we have something here if we can convert to long? // // Now we can just do it with single precision. I am using the binary gcd method, // as it should be faster. // uint yy = x.data [0]; uint xx = y % yy; int t = 0; while (((xx | yy) & 1) == 0) { xx >>= 1; yy >>= 1; t++; } while (xx != 0) { while ((xx & 1) == 0) xx >>= 1; while ((yy & 1) == 0) yy >>= 1; if (xx >= yy) xx = (xx - yy) >> 1; else yy = (yy - xx) >> 1; } return yy << t; } public static uint modInverse (BigInteger bi, uint modulus) { uint a = modulus, b = bi % modulus; uint p0 = 0, p1 = 1; while (b != 0) { if (b == 1) return p1; p0 += (a / b) * p1; a %= b; if (a == 0) break; if (a == 1) return modulus-p0; p1 += (b / a) * p0; b %= a; } return 0; } public static BigInteger modInverse (BigInteger bi, BigInteger modulus) { if (modulus.length == 1) return modInverse (bi, modulus.data [0]); BigInteger [] p = { 0, 1 }; BigInteger [] q = new BigInteger [2]; // quotients BigInteger [] r = { 0, 0 }; // remainders int step = 0; BigInteger a = modulus; BigInteger b = bi; ModulusRing mr = new ModulusRing (modulus); while (b != 0) { if (step > 1) { BigInteger pval = mr.Difference (p [0], p [1] * q [0]); p [0] = p [1]; p [1] = pval; } BigInteger [] divret = multiByteDivide (a, b); q [0] = q [1]; q [1] = divret [0]; r [0] = r [1]; r [1] = divret [1]; a = b; b = divret [1]; step++; } if (r [0] != 1) throw (new ArithmeticException ("No inverse!")); return mr.Difference (p [0], p [1] * q [0]); } #endregion } } } ================================================ FILE: Mono/ConfidenceFactor.cs ================================================ // // Mono.Math.Prime.ConfidenceFactor.cs - Confidence factor for prime generation // // Authors: // Ben Maurer // // Copyright (c) 2003 Ben Maurer. All rights reserved // // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Math.Prime { /// /// A factor of confidence. /// #if INSIDE_CORLIB internal #else public #endif enum ConfidenceFactor { /// /// Only suitable for development use, probability of failure may be greater than 1/2^20. /// ExtraLow, /// /// Suitable only for transactions which do not require forward secrecy. Probability of failure about 1/2^40 /// Low, /// /// Designed for production use. Probability of failure about 1/2^80. /// Medium, /// /// Suitable for sensitive data. Probability of failure about 1/2^160. /// High, /// /// Use only if you have lots of time! Probability of failure about 1/2^320. /// ExtraHigh, /// /// Only use methods which generate provable primes. Not yet implemented. /// Provable } } ================================================ FILE: Mono/NextPrimeFinder.cs ================================================ // // Mono.Math.Prime.Generator.NextPrimeFinder.cs - Prime Generator // // Authors: // Ben Maurer // // Copyright (c) 2003 Ben Maurer. All rights reserved // // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Math.Prime.Generator { /// /// Finds the next prime after a given number. /// #if INSIDE_CORLIB internal #else public #endif class NextPrimeFinder : SequentialSearchPrimeGeneratorBase { protected override BigInteger GenerateSearchBase (int bits, object Context) { if (Context == null) throw new ArgumentNullException ("Context"); BigInteger ret = new BigInteger ((BigInteger)Context); ret.SetBit (0); return ret; } } } ================================================ FILE: Mono/PrimalityTests.cs ================================================ // // Mono.Math.Prime.PrimalityTests.cs - Test for primality // // Authors: // Ben Maurer // // Copyright (c) 2003 Ben Maurer. All rights reserved // // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Math.Prime { #if INSIDE_CORLIB internal #else public #endif delegate bool PrimalityTest (BigInteger bi, ConfidenceFactor confidence); #if INSIDE_CORLIB internal #else public #endif sealed class PrimalityTests { private PrimalityTests () { } #region SPP Test private static int GetSPPRounds (BigInteger bi, ConfidenceFactor confidence) { int bc = bi.BitCount(); int Rounds; // Data from HAC, 4.49 if (bc <= 100 ) Rounds = 27; else if (bc <= 150 ) Rounds = 18; else if (bc <= 200 ) Rounds = 15; else if (bc <= 250 ) Rounds = 12; else if (bc <= 300 ) Rounds = 9; else if (bc <= 350 ) Rounds = 8; else if (bc <= 400 ) Rounds = 7; else if (bc <= 500 ) Rounds = 6; else if (bc <= 600 ) Rounds = 5; else if (bc <= 800 ) Rounds = 4; else if (bc <= 1250) Rounds = 3; else Rounds = 2; switch (confidence) { case ConfidenceFactor.ExtraLow: Rounds >>= 2; return Rounds != 0 ? Rounds : 1; case ConfidenceFactor.Low: Rounds >>= 1; return Rounds != 0 ? Rounds : 1; case ConfidenceFactor.Medium: return Rounds; case ConfidenceFactor.High: return Rounds << 1; case ConfidenceFactor.ExtraHigh: return Rounds << 2; case ConfidenceFactor.Provable: throw new Exception ("The Rabin-Miller test can not be executed in a way such that its results are provable"); default: throw new ArgumentOutOfRangeException ("confidence"); } } public static bool Test (BigInteger n, ConfidenceFactor confidence) { // Rabin-Miller fails with smaller primes (at least with our BigInteger code) if (n.BitCount () < 33) return SmallPrimeSppTest (n, confidence); else return RabinMillerTest (n, confidence); } /// /// Probabilistic prime test based on Rabin-Miller's test /// /// /// /// The number to test. /// /// /// /// /// The number of chosen bases. The test has at least a /// 1/4^confidence chance of falsely returning True. /// /// /// /// /// True if "this" is a strong pseudoprime to randomly chosen bases. /// /// /// False if "this" is definitely NOT prime. /// /// public static bool RabinMillerTest (BigInteger n, ConfidenceFactor confidence) { int bits = n.BitCount (); int t = GetSPPRounds (bits, confidence); // n - 1 == 2^s * r, r is odd BigInteger n_minus_1 = n - 1; int s = n_minus_1.LowestSetBit (); BigInteger r = n_minus_1 >> s; BigInteger.ModulusRing mr = new BigInteger.ModulusRing (n); // Applying optimization from HAC section 4.50 (base == 2) // not a really random base but an interesting (and speedy) one BigInteger y = null; // FIXME - optimization disable for small primes due to bug #81857 if (n.BitCount () > 100) y = mr.Pow (2, r); // still here ? start at round 1 (round 0 was a == 2) for (int round = 0; round < t; round++) { if ((round > 0) || (y == null)) { BigInteger a = null; // check for 2 <= a <= n - 2 // ...but we already did a == 2 previously as an optimization do { a = BigInteger.GenerateRandom (bits); } while ((a <= 2) && (a >= n_minus_1)); y = mr.Pow (a, r); } if (y == 1) continue; for (int j = 0; ((j < s) && (y != n_minus_1)); j++) { y = mr.Pow (y, 2); if (y == 1) return false; } if (y != n_minus_1) return false; } return true; } public static bool SmallPrimeSppTest (BigInteger bi, ConfidenceFactor confidence) { int Rounds = GetSPPRounds (bi, confidence); // calculate values of s and t BigInteger p_sub1 = bi - 1; int s = p_sub1.LowestSetBit (); BigInteger t = p_sub1 >> s; BigInteger.ModulusRing mr = new BigInteger.ModulusRing (bi); for (int round = 0; round < Rounds; round++) { BigInteger b = mr.Pow (BigInteger.smallPrimes [round], t); if (b == 1) continue; // a^t mod p = 1 bool result = false; for (int j = 0; j < s; j++) { if (b == p_sub1) { // a^((2^j)*t) mod p = p-1 for some 0 <= j <= s-1 result = true; break; } b = (b * b) % bi; } if (result == false) return false; } return true; } #endregion // TODO: Implement the Lucus test // TODO: Implement other new primality tests // TODO: Implement primality proving } } ================================================ FILE: Mono/PrimeGeneratorBase.cs ================================================ // // Mono.Math.Prime.Generator.PrimeGeneratorBase.cs - Abstract Prime Generator // // Authors: // Ben Maurer // // Copyright (c) 2003 Ben Maurer. All rights reserved // // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.Math.Prime.Generator { #if INSIDE_CORLIB internal #else public #endif abstract class PrimeGeneratorBase { public virtual ConfidenceFactor Confidence { get { #if DEBUG return ConfidenceFactor.ExtraLow; #else return ConfidenceFactor.Medium; #endif } } public virtual Prime.PrimalityTest PrimalityTest { get { return new Prime.PrimalityTest (PrimalityTests.RabinMillerTest); } } public virtual int TrialDivisionBounds { get { return 4000; } } /// /// Performs primality tests on bi, assumes trial division has been done. /// /// A BigInteger that has been subjected to and passed trial division /// False if bi is composite, true if it may be prime. /// The speed of this method is dependent on Confidence protected bool PostTrialDivisionTests (BigInteger bi) { return PrimalityTest (bi, this.Confidence); } public abstract BigInteger GenerateNewPrime (int bits); } } ================================================ FILE: Mono/SequentialSearchPrimeGeneratorBase.cs ================================================ // // Mono.Math.Prime.Generator.SequentialSearchPrimeGeneratorBase.cs - Prime Generator // // Authors: // Ben Maurer // // Copyright (c) 2003 Ben Maurer. All rights reserved // Copyright (C) 2004 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.Math.Prime.Generator { #if INSIDE_CORLIB internal #else public #endif class SequentialSearchPrimeGeneratorBase : PrimeGeneratorBase { protected virtual BigInteger GenerateSearchBase (int bits, object context) { BigInteger ret = BigInteger.GenerateRandom (bits); ret.SetBit (0); return ret; } public override BigInteger GenerateNewPrime (int bits) { return GenerateNewPrime (bits, null); } public virtual BigInteger GenerateNewPrime (int bits, object context) { // // STEP 1. Find a place to do a sequential search // BigInteger curVal = GenerateSearchBase (bits, context); const uint primeProd1 = 3u* 5u * 7u * 11u * 13u * 17u * 19u * 23u * 29u; uint pMod1 = curVal % primeProd1; int DivisionBound = TrialDivisionBounds; uint[] SmallPrimes = BigInteger.smallPrimes; // // STEP 2. Search for primes // while (true) { // // STEP 2.1 Sieve out numbers divisible by the first 9 primes // if (pMod1 % 3 == 0) goto biNotPrime; if (pMod1 % 5 == 0) goto biNotPrime; if (pMod1 % 7 == 0) goto biNotPrime; if (pMod1 % 11 == 0) goto biNotPrime; if (pMod1 % 13 == 0) goto biNotPrime; if (pMod1 % 17 == 0) goto biNotPrime; if (pMod1 % 19 == 0) goto biNotPrime; if (pMod1 % 23 == 0) goto biNotPrime; if (pMod1 % 29 == 0) goto biNotPrime; // // STEP 2.2 Sieve out all numbers divisible by the primes <= DivisionBound // for (int p = 10; p < SmallPrimes.Length && SmallPrimes [p] <= DivisionBound; p++) { if (curVal % SmallPrimes [p] == 0) goto biNotPrime; } // // STEP 2.3 Is the potential prime acceptable? // if (!IsPrimeAcceptable (curVal, context)) goto biNotPrime; // // STEP 2.4 Filter out all primes that pass this step with a primality test // if (PrimalityTest (curVal, Confidence)) return curVal; // // STEP 2.4 // biNotPrime: pMod1 += 2; if (pMod1 >= primeProd1) pMod1 -= primeProd1; curVal.Incr2 (); } } protected virtual bool IsPrimeAcceptable (BigInteger bi, object context) { return true; } } } ================================================ FILE: Prf10.cs ================================================ using System; using System.IO; using System.Security.Cryptography; namespace Moserware.TlsAnalyzer { /// /// Implements the TLS 1.0 Pseudorandom Function (PRF) /// /// /// The bulk of comments come from Section 5 of RFC 2246. /// Note that the PRF changed notably between TLS 1.0 and TLS 1.2. Only the 1.0 version is /// implemented here. /// public static class Prf10 { // PRF(secret, label, seed) = P_MD5(S1, label + seed) XOR // P_SHA-1(S2, label + seed); /// /// Generates bytes using the TLS 1.0 Pseudo-Random Function /// /// The secret used for deriving bytes. /// The ASCII label to use for deriving bytes. /// The seed used to derive bytes. /// The total number of bytes to generate. /// derived bytes using the TLS 1.0 PRF function. public static byte[] GenerateBytes(byte[] secret, string label, byte[] seed, int bytesToGenerate) { byte[] labelBytes = label.ToAsciiBytes(); byte[] labelAndSeed = new byte[labelBytes.Length + seed.Length]; // labelAndSeed = label + seed Buffer.BlockCopy(labelBytes, 0, labelAndSeed, 0, labelBytes.Length); Buffer.BlockCopy(seed, 0, labelAndSeed, labelBytes.Length, seed.Length); byte[] s1; byte[] s2; Split(secret, out s1, out s2); byte[] pMD5 = PMD5(s1, labelAndSeed, bytesToGenerate); byte[] pSHA1 = PSHA1(s2, labelAndSeed, bytesToGenerate); byte[] result = new byte[pMD5.Length]; for (int i = 0; i < result.Length; i++) { result[i] = (byte) (pMD5[i] ^ pSHA1[i]); } return result; } // (from Section 5 of RFC 2246) // TLS's PRF is created by splitting the secret into two halves and // using one half to generate data with P_MD5 and the other half to // generate data with P_SHA-1, then exclusive-or'ing the outputs of // these two expansion functions together. // S1 and S2 are the two halves of the secret and each is the same // length. S1 is taken from the first half of the secret, S2 from the // second half. Their length is created by rounding up the length of the // overall secret divided by two; thus, if the original secret is an odd // number of bytes long, the last byte of S1 will be the same as the // first byte of S2. // L_S = length in bytes of secret; // L_S1 = L_S2 = ceil(L_S / 2); internal static void Split(byte[] input, out byte[] s1, out byte[] s2) { int padding = (input.Length % 2); int halfSize = (input.Length / 2) + padding; s1 = new byte[halfSize]; Buffer.BlockCopy(input, 0, s1, 0, halfSize); s2 = new byte[halfSize]; Buffer.BlockCopy(input, input.Length - halfSize, s2, 0, halfSize); } // From section 5 of RFC 2246 // P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) + // HMAC_hash(secret, A(2) + seed) + // HMAC_hash(secret, A(3) + seed) + ... // A() is defined as: // A(0) = seed // A(i) = HMAC_hash(secret, A(i-1)) private static byte[] PHash(HMAC hmac, byte[] seed, int bytesToGenerate) { using(MemoryStream bytesToHashBuffer = new MemoryStream()) using (MemoryStream output = new MemoryStream()) { byte[] previousA = seed; while (output.Length < bytesToGenerate) { bytesToHashBuffer.SetLength(0); byte[] currentA = A(hmac, previousA); bytesToHashBuffer.Write(currentA, 0, currentA.Length); bytesToHashBuffer.Write(seed, 0, seed.Length); byte[] currentBuffer = bytesToHashBuffer.GetBuffer(); byte[] currentRoundResult = hmac.ComputeHash(currentBuffer, 0, (int) bytesToHashBuffer.Length); output.Write(currentRoundResult, 0, currentRoundResult.Length); previousA = currentA; } output.SetLength(bytesToGenerate); return output.ToArray(); } } private static byte[] A(HMAC hmac, byte[] aMinus1Result) { return hmac.ComputeHash(aMinus1Result); } private static byte[] PMD5(byte[] secret, byte[] seed, int bytesDesired) { return PHash(new HMACMD5(secret), seed, bytesDesired); } private static byte[] PSHA1(byte[] secret, byte[] seed, int bytesDesired) { return PHash(new HMACSHA1(secret), seed, bytesDesired); } } } ================================================ FILE: Program.cs ================================================ using System; using System.Windows.Forms; namespace Moserware.TlsAnalyzer { static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } } } ================================================ FILE: Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TlsAnalyzer")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Moserware")] [assembly: AssemblyProduct("TlsAnalyzer")] [assembly: AssemblyCopyright("Copyright © Jeff Moser 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ec6f55e1-1d54-45c5-bfdc-a49fa3cf7f7d")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: InternalsVisibleTo("TlsAnalyzer.UnitTests")] ================================================ FILE: Properties/Settings.Designer.cs ================================================ //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace Moserware.TlsAnalyzer.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("ABABABABABABABABABABABABABABABAB ABABABABABABABABABABABABABABABAB ABABABABABABABA" + "BABABABABABABABAB")] public string PrfSecretBytes { get { return ((string)(this["PrfSecretBytes"])); } set { this["PrfSecretBytes"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("PRF Testvector")] public string PrfLabel { get { return ((string)(this["PrfLabel"])); } set { this["PrfLabel"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD CDCDCDCDCDCDCDC" + "DCDCDCDCDCDCDCDCD CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD")] public string PrfSeedBytes { get { return ((string)(this["PrfSeedBytes"])); } set { this["PrfSeedBytes"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("104")] public decimal PrfBytesToGenerate { get { return ((decimal)(this["PrfBytesToGenerate"])); } set { this["PrfBytesToGenerate"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("Jefe")] public string HmacKey { get { return ((string)(this["HmacKey"])); } set { this["HmacKey"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("what do ya want for nothing?")] public string HmacData { get { return ((string)(this["HmacData"])); } set { this["HmacData"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute(@"4456: SSL[131491792]: Pre-Master Secret [Len: 48] 03 01 bb 7b 08 98 a7 49 de e8 e9 b8 91 52 ec 81 ...{...I.....R.. 4c c2 39 7b f6 ba 1c 0a b1 95 50 29 be 02 ad e6 L.9{......P).... ad 6e 11 3f 20 c4 66 f0 64 22 57 7e e1 06 7a 3b .n.? .f.d""W~..z; ")] public string PreMasterSecret { get { return ((string)(this["PreMasterSecret"])); } set { this["PreMasterSecret"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("4a2f07cab94fb3067a06567fcec9f737bd5270f7002bb0d6723e551a0d57d982")] public string ClientRandomBytes { get { return ((string)(this["ClientRandomBytes"])); } set { this["ClientRandomBytes"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("4a2f07ca986be7a3acdd547d038235895aba467eed6eb07cd46e5e8a199e0c13")] public string ServerRandomBytes { get { return ((string)(this["ServerRandomBytes"])); } set { this["ServerRandomBytes"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute(@"0100009a03014a2f07cab94fb3067a06567fcec9f737bd5270f7002bb0d6723e551a0d57d982000044c00ac0140088008700390038c00fc00500840035c007c009c011c0130045004400330032c00cc00ec002c004004100040005002fc008c01200160013c00dc003feff000a0100002d00000013001100000e7777772e616d617a6f6e2e636f6d000a00080006001700180019000b0002010000230000")] public string ClientHello { get { return ((string)(this["ClientHello"])); } set { this["ClientHello"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0200004603014a2f07ca986be7a3acdd547d038235895aba467eed6eb07cd46e5e8a199e0c1320acd" + "07167996609e3584d15c2d43596d8ab93cfa9e899a82aa1652b8ab667a12b000400")] public string ServerHello { get { return ((string)(this["ServerHello"])); } set { this["ServerHello"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0b0009a000099d0004f7308204f3308203dba0030201020210169d041c3130be3d566606f2679ba17" + "2300d06092a864886f70d01010505003081b0310b300906035504061302555331173015060355040" + "a130e566572695369676e2c20496e632e311f301d060355040b1316566572695369676e205472757" + "374204e6574776f726b313b3039060355040b13325465726d73206f6620757365206174206874747" + "0733a2f2f7777772e766572697369676e2e636f6d2f727061202863293035312a302806035504031" + "321566572695369676e20436c61737320332053656375726520536572766572204341301e170d303" + "8303832373030303030305a170d3039303832373233353935395a3067310b3009060355040613025" + "553311330110603550408130a57617368696e67746f6e3110300e0603550407140753656174746c6" + "531183016060355040a140f416d617a6f6e2e636f6d20496e632e311730150603550403140e77777" + "72e616d617a6f6e2e636f6d30819f300d06092a864886f70d010101050003818d003081890281810" + "0c5176d5880046305c91466c7b7f2ed05d6f3f528212f0e829c86dbf35981cd6f5c669aff9e2d937" + "38e795a347501aa7bb90379fc085405827744914d160f2f3ade9a793413eba875e323e5a82ba577b" + "45d0908be25ccd5fd44916971f9a772533d7edffcf7cc84241cc803cd8e5764ea121169c988670e1" + "c28550351a58b2adb0203010001a38201d3308201cf30090603551d1304023000300b0603551d0f0" + "404030205a030440603551d1f043d303b3039a037a0358633687474703a2f2f53565253656375726" + "52d63726c2e766572697369676e2e636f6d2f535652536563757265323030352e63726c304406035" + "51d20043d303b3039060b6086480186f84501071703302a302806082b06010505070201161c68747" + "470733a2f2f7777772e766572697369676e2e636f6d2f727061301d0603551d250416301406082b0" + "601050507030106082b06010505070302301f0603551d230418301680146fecafa0dd8aa4eff52a1" + "0672d3f5582bcd7ef25307906082b06010505070101046d306b302406082b0601050507300186186" + "87474703a2f2f6f6373702e766572697369676e2e636f6d304306082b06010505073002863768747" + "4703a2f2f5356525365637572652d6169612e766572697369676e2e636f6d2f53565253656375726" + "5323030352d6169612e636572306e06082b0601050507010c04623060a15ea05c305a30583056160" + "9696d6167652f6769663021301f300706052b0e03021a04144b6bb92896060cbbd052389b29ac4b0" + "78b21051830261624687474703a2f2f6c6f676f2e766572697369676e2e636f6d2f76736c6f676f3" + "12e676966300d06092a864886f70d010105050003820101003feb3eff141d141d684f6d0c571d2c0" + "5e0df6161174a949272d043c6d5f20172193abba420fda6f193312c6d8b91ad6a41c993b2f99cf68" + "0d3767049d067447c4b43864f91e2c3c2f6f0703f7d3044e77ec83058ce81634773cdcb019301e91" + "89cba318316a793b5f9f5230ff832d2d661f7c05587666cd757052ce5967ec836743aa68b526903d" + "09db325bb8547892d5c924ae3ff3fa9a854d4d84a9b7af7a8cd8237db964c843a876b8385d955d64" + "fcb2aacf40b15e8a06e0491c3bc6892a420d828af09738ff492fc23b9c521d7cff6175fba59cbd0c" + "dd5b9f99876fad5fa98904a2338330336d66906cd196f8b8b173070aef1d14f8c18c38fefc328667" + "30004a03082049c30820405a003020102021075337d9ab0e1233bae2d7de4469162d4300d06092a8" + "64886f70d0101050500305f310b300906035504061302555331173015060355040a130e566572695" + "369676e2c20496e632e31373035060355040b132e436c6173732033205075626c6963205072696d6" + "172792043657274696669636174696f6e20417574686f72697479301e170d3035303131393030303" + "030305a170d3135303131383233353935395a3081b0310b300906035504061302555331173015060" + "355040a130e566572695369676e2c20496e632e311f301d060355040b1316566572695369676e205" + "472757374204e6574776f726b313b3039060355040b13325465726d73206f6620757365206174206" + "8747470733a2f2f7777772e766572697369676e2e636f6d2f727061202863293035312a302806035" + "504031321566572695369676e20436c6173732033205365637572652053657276657220434130820" + "122300d06092a864886f70d01010105000382010f003082010a028201010095c321128e40c50d015" + "f765e6694d9732c581922b8c9fc7a39902a77727c1d3ef7d855e3af42cb873002dc5bac70e6b844b" + "42b35eb93d217057ecb46d65c53a032519d746458f90c9a00ea5e44496472f4cd10e2850af934eeb" + "38866a9a5a45ad00e987f580d2b52bb86a97e2efab2487c8ddb2d5f0175a28d063b8bb46107c9be2" + "299f81bd1b55766044d35f4917196b59908259b97c83af320b1dd9e980c4a63b7a6ceb001cef8936" + "af30c6e9fb1e9847b819841e681dc3d2ce7b46be39efc0816d7b3d5b96612997c6d71c84dbec70fe" + "3fb37add57587216b86d044145a547939966956c9b931cd896158e1d9760505adf7b902afa7fd479" + "1a222345a31d10203010001a38201813082017d30120603551d130101ff040830060101ff0201003" + "0440603551d20043d303b3039060b6086480186f84501071703302a302806082b060105050702011" + "61c68747470733a2f2f7777772e766572697369676e2e636f6d2f72706130310603551d1f042a302" + "83026a024a0228620687474703a2f2f63726c2e766572697369676e2e636f6d2f706361332e63726" + "c300e0603551d0f0101ff040403020106301106096086480186f8420101040403020106302906035" + "51d1104223020a41e301c311a301806035504031311436c617373334341323034382d312d3435301" + "d0603551d0e041604146fecafa0dd8aa4eff52a10672d3f5582bcd7ef253081800603551d2304793" + "077a163a461305f310b300906035504061302555331173015060355040a130e566572695369676e2" + "c20496e632e31373035060355040b132e436c6173732033205075626c6963205072696d617279204" + "3657274696669636174696f6e20417574686f72697479821070bae41d10d92934b638ca7b03ccbab" + "f300d06092a864886f70d010105050003818100c37e08465d9136cf67dcd7a7afafb822c38b0474d" + "3b160bce6feb74412815b3173146356c6722ed11a03435c380a504a4dcddab619a8f4990dafe3f7d" + "8f1752865f66afe9bf4bd52d93fcbda16cba59e2e8e6652783d26fafe9436884a955e2a4c19ef6ef" + "a823f2d03efd628b33718cf42b234216447d3206b3a4cdce603900c")] public string ServerHelloCertificate { get { return ((string)(this["ServerHelloCertificate"])); } set { this["ServerHelloCertificate"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0e000000")] public string ServerHelloDone { get { return ((string)(this["ServerHelloDone"])); } set { this["ServerHelloDone"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute(@"1000008200808c0863cc016cd036efa22889e1611a8a03304366ebb04da1cb918548e024f488a155cd85030b5bd7e67a9da2019089ceba571100051cafceeff42b3fe630f26e7d55e6d6c80976851da2517e28bf831ebe0bed601c9b00c52ea62238eda3fb7edd689ac2addc2341ba30f0cd95604885ed448e828346c3b71206ae48114eb2da")] public string ClientEncryptedKeyExchange { get { return ((string)(this["ClientEncryptedKeyExchange"])); } set { this["ClientEncryptedKeyExchange"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("6a207a41660bd66cf7be3f41ded028c24a612db5301673c1e6317a42222c2f96")] public string ClientEncryptedFinishedMessage { get { return ((string)(this["ClientEncryptedFinishedMessage"])); } set { this["ClientEncryptedFinishedMessage"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("4c95745d193fd3d4645d95280a49b80e02d4d479b44475cae3527b9e808ecc69")] public string ServerEncryptedFinishedMessage { get { return ((string)(this["ServerEncryptedFinishedMessage"])); } set { this["ServerEncryptedFinishedMessage"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute(@"183AF27ABF7AE61392D03958A7D4CC9D7B37CF30A52DFD2DD9546538FE2E9DB30A49AF7AB7265E56F12E07D12359DDE4456F222E8F135187A095817D4CDE3C66A54AEE91F9F347D076E81C1C6D533CB11BD3193EBDC5E5F711DC42B099559E287A7FA0867AEB830B6CC076A7E6665BBD341BA0E31CBCF3D9A067AD7B4038A1F3BDB3BCE7790E27E2FFF67E5D3518405E37D6A66A76F6E1DBA32DB9A69BDCDE33002627051E1BDBFBF64F6D3FB33EE301139ADA7D03F5F00AC193D3EB05D83198D2EB722848E8ABBC97FE529863E54A098621E6DE5F00DA7BC70DB6FDCD11F9DDE3C33AB15DFBFADD8F8D90E564B2D4DB1E25F5FE28E4D748AD01E42CEE5B30745404C4324C1CC4A421F85C65019B87A9C5CFCCB34D90D45195E28E6E30686D77B4F2F727DB2F583F7137BC0F1D22D59DF897C2B14C77B4C50BA97F88C7CB38B3478FE825970250851A95C9D546D6BB39B265CBBF944F35D0F0924D8D9F4BC05A7D7C55165F81D81B52F0B0BF92D6FDB67C35079B286E0886ACC380C047A031FC6FB5B46DA45D81EBC440CD34229282FDE09FCFCA8E28C0C11DFF664CB486C11BA64A70E73192A66951E206492713173CDDC988515D973E1531155C548E6D8FF5AD623F6C009D2916F1B45E9A0FE80EED21B29A200975EAFAFC982104482A8BEB4DCA45B605E3B2F9984B6E51FEFE86C5B82FC0C9CBA092070450A14D")] public string ClientApplicationData { get { return ((string)(this["ClientApplicationData"])); } set { this["ClientApplicationData"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute(@"7FEF3541D25C5F37F46461988729B6EF873D59F35C844B1BFA23D1F257C670FB2E26E6FD5F5162849401E966D1E65EE39FAFB65D1B882F6E3284B1B473B00749F00AA656C8496C9FB09FD62E6D5A09ABA51BB474A63B521A28702A74B24E658065DAA1793D971FD5DD7B433BC9EBBFA1E3B92A4FF35A496740EA9691C1F4A57CAA28213DB2CAEF38E4D94CFEE4102FF34EC669280F0303A24025581E281F4F421917F169329F730B5C62CF68EF3CCEBCDCCE3E9DF78652F1A43E4986B9DE9CC2F7DA5563A34CF417EFD045EF46DAAD8CA3D72E50E4F3B0D4323399AE647DF8A7B9A12E103E0C79A222F798BC9C2317D85929C6E73C96EE03CC63B0FF2F4C94E411B9A6F536AFD7BDBAD279171CD6C39B2018161889A18998BCB92B4D250CD6249F6763BCAF1E03ED12DA38D5D71C79CAAFDB0BA823E702645852D923577F35CC82F59A5AF91B13901042F9AB4CAAD09CFD6226FA4AA92F14D96698E639245BF2F247927EE92466395A16EF31949EBD75428E57D43848E15C66F44E207A69AD301F9CE5826ABFEBCA4927D1BED3331CEEFB9E8C959C97245CB65EDF7EA24F31FC59BC312DA9A3AE81E3C34418ED69FAC2FFAC61D90BE93521633CD10266334F6AE59A69B6B733CE1A6E01D119B91FCAC2571062C0EB2FC79601405D1F349213AED9E9D520DAD50F9FE6E39CE9B96607D6934CBF1C0870F1761A7421BCBCED09D3896012B92281D1E1CB92 4939489ACA4CB1FFE5D096AA9F944746")] public string ServerApplicationData { get { return ((string)(this["ServerApplicationData"])); } set { this["ServerApplicationData"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute(@"00 02 12 A3 EA B1 65 D6 81 6C 13 14 13 62 10 53 23 B3 96 85 FF 24 FA CC 46 11 21 24 A4 81 EA 30 63 95 D4 DC BF 9C CC D0 2E DD 5A A6 41 6A 4E 82 65 7D 70 7D 50 09 17 CD 10 55 97 B9 C1 A1 84 F2 A9 AB EA 7D F4 CC 54 E4 64 6E 3A E5 91 A0 06 00 03 01 BB 7B 08 98 A7 49 DE E8 E9 B8 91 52 EC 81 4C C2 39 7B F6 BA 1C 0A B1 95 50 29 BE 02 AD E6 AD 6E 11 3F 20 C4 66 F0 64 22 57 7E E1 06 7A 3B")] public string DecryptedClientKeyExchange { get { return ((string)(this["DecryptedClientKeyExchange"])); } set { this["DecryptedClientKeyExchange"] = value; } } } } ================================================ FILE: Properties/Settings.settings ================================================  ABABABABABABABABABABABABABABABAB ABABABABABABABABABABABABABABABAB ABABABABABABABABABABABABABABABAB PRF Testvector CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD 104 Jefe what do ya want for nothing? 4456: SSL[131491792]: Pre-Master Secret [Len: 48] 03 01 bb 7b 08 98 a7 49 de e8 e9 b8 91 52 ec 81 ...{...I.....R.. 4c c2 39 7b f6 ba 1c 0a b1 95 50 29 be 02 ad e6 L.9{......P).... ad 6e 11 3f 20 c4 66 f0 64 22 57 7e e1 06 7a 3b .n.? .f.d"W~..z; 4a2f07cab94fb3067a06567fcec9f737bd5270f7002bb0d6723e551a0d57d982 4a2f07ca986be7a3acdd547d038235895aba467eed6eb07cd46e5e8a199e0c13 0100009a03014a2f07cab94fb3067a06567fcec9f737bd5270f7002bb0d6723e551a0d57d982000044c00ac0140088008700390038c00fc00500840035c007c009c011c0130045004400330032c00cc00ec002c004004100040005002fc008c01200160013c00dc003feff000a0100002d00000013001100000e7777772e616d617a6f6e2e636f6d000a00080006001700180019000b0002010000230000 0200004603014a2f07ca986be7a3acdd547d038235895aba467eed6eb07cd46e5e8a199e0c1320acd07167996609e3584d15c2d43596d8ab93cfa9e899a82aa1652b8ab667a12b000400 0b0009a000099d0004f7308204f3308203dba0030201020210169d041c3130be3d566606f2679ba172300d06092a864886f70d01010505003081b0310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e311f301d060355040b1316566572695369676e205472757374204e6574776f726b313b3039060355040b13325465726d73206f66207573652061742068747470733a2f2f7777772e766572697369676e2e636f6d2f727061202863293035312a302806035504031321566572695369676e20436c61737320332053656375726520536572766572204341301e170d3038303832373030303030305a170d3039303832373233353935395a3067310b3009060355040613025553311330110603550408130a57617368696e67746f6e3110300e0603550407140753656174746c6531183016060355040a140f416d617a6f6e2e636f6d20496e632e311730150603550403140e7777772e616d617a6f6e2e636f6d30819f300d06092a864886f70d010101050003818d0030818902818100c5176d5880046305c91466c7b7f2ed05d6f3f528212f0e829c86dbf35981cd6f5c669aff9e2d93738e795a347501aa7bb90379fc085405827744914d160f2f3ade9a793413eba875e323e5a82ba577b45d0908be25ccd5fd44916971f9a772533d7edffcf7cc84241cc803cd8e5764ea121169c988670e1c28550351a58b2adb0203010001a38201d3308201cf30090603551d1304023000300b0603551d0f0404030205a030440603551d1f043d303b3039a037a0358633687474703a2f2f5356525365637572652d63726c2e766572697369676e2e636f6d2f535652536563757265323030352e63726c30440603551d20043d303b3039060b6086480186f84501071703302a302806082b06010505070201161c68747470733a2f2f7777772e766572697369676e2e636f6d2f727061301d0603551d250416301406082b0601050507030106082b06010505070302301f0603551d230418301680146fecafa0dd8aa4eff52a10672d3f5582bcd7ef25307906082b06010505070101046d306b302406082b060105050730018618687474703a2f2f6f6373702e766572697369676e2e636f6d304306082b060105050730028637687474703a2f2f5356525365637572652d6169612e766572697369676e2e636f6d2f535652536563757265323030352d6169612e636572306e06082b0601050507010c04623060a15ea05c305a305830561609696d6167652f6769663021301f300706052b0e03021a04144b6bb92896060cbbd052389b29ac4b078b21051830261624687474703a2f2f6c6f676f2e766572697369676e2e636f6d2f76736c6f676f312e676966300d06092a864886f70d010105050003820101003feb3eff141d141d684f6d0c571d2c05e0df6161174a949272d043c6d5f20172193abba420fda6f193312c6d8b91ad6a41c993b2f99cf680d3767049d067447c4b43864f91e2c3c2f6f0703f7d3044e77ec83058ce81634773cdcb019301e9189cba318316a793b5f9f5230ff832d2d661f7c05587666cd757052ce5967ec836743aa68b526903d09db325bb8547892d5c924ae3ff3fa9a854d4d84a9b7af7a8cd8237db964c843a876b8385d955d64fcb2aacf40b15e8a06e0491c3bc6892a420d828af09738ff492fc23b9c521d7cff6175fba59cbd0cdd5b9f99876fad5fa98904a2338330336d66906cd196f8b8b173070aef1d14f8c18c38fefc32866730004a03082049c30820405a003020102021075337d9ab0e1233bae2d7de4469162d4300d06092a864886f70d0101050500305f310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e31373035060355040b132e436c6173732033205075626c6963205072696d6172792043657274696669636174696f6e20417574686f72697479301e170d3035303131393030303030305a170d3135303131383233353935395a3081b0310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e311f301d060355040b1316566572695369676e205472757374204e6574776f726b313b3039060355040b13325465726d73206f66207573652061742068747470733a2f2f7777772e766572697369676e2e636f6d2f727061202863293035312a302806035504031321566572695369676e20436c6173732033205365637572652053657276657220434130820122300d06092a864886f70d01010105000382010f003082010a028201010095c321128e40c50d015f765e6694d9732c581922b8c9fc7a39902a77727c1d3ef7d855e3af42cb873002dc5bac70e6b844b42b35eb93d217057ecb46d65c53a032519d746458f90c9a00ea5e44496472f4cd10e2850af934eeb38866a9a5a45ad00e987f580d2b52bb86a97e2efab2487c8ddb2d5f0175a28d063b8bb46107c9be2299f81bd1b55766044d35f4917196b59908259b97c83af320b1dd9e980c4a63b7a6ceb001cef8936af30c6e9fb1e9847b819841e681dc3d2ce7b46be39efc0816d7b3d5b96612997c6d71c84dbec70fe3fb37add57587216b86d044145a547939966956c9b931cd896158e1d9760505adf7b902afa7fd4791a222345a31d10203010001a38201813082017d30120603551d130101ff040830060101ff02010030440603551d20043d303b3039060b6086480186f84501071703302a302806082b06010505070201161c68747470733a2f2f7777772e766572697369676e2e636f6d2f72706130310603551d1f042a30283026a024a0228620687474703a2f2f63726c2e766572697369676e2e636f6d2f706361332e63726c300e0603551d0f0101ff040403020106301106096086480186f842010104040302010630290603551d1104223020a41e301c311a301806035504031311436c617373334341323034382d312d3435301d0603551d0e041604146fecafa0dd8aa4eff52a10672d3f5582bcd7ef253081800603551d2304793077a163a461305f310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e31373035060355040b132e436c6173732033205075626c6963205072696d6172792043657274696669636174696f6e20417574686f72697479821070bae41d10d92934b638ca7b03ccbabf300d06092a864886f70d010105050003818100c37e08465d9136cf67dcd7a7afafb822c38b0474d3b160bce6feb74412815b3173146356c6722ed11a03435c380a504a4dcddab619a8f4990dafe3f7d8f1752865f66afe9bf4bd52d93fcbda16cba59e2e8e6652783d26fafe9436884a955e2a4c19ef6efa823f2d03efd628b33718cf42b234216447d3206b3a4cdce603900c 0e000000 1000008200808c0863cc016cd036efa22889e1611a8a03304366ebb04da1cb918548e024f488a155cd85030b5bd7e67a9da2019089ceba571100051cafceeff42b3fe630f26e7d55e6d6c80976851da2517e28bf831ebe0bed601c9b00c52ea62238eda3fb7edd689ac2addc2341ba30f0cd95604885ed448e828346c3b71206ae48114eb2da 6a207a41660bd66cf7be3f41ded028c24a612db5301673c1e6317a42222c2f96 4c95745d193fd3d4645d95280a49b80e02d4d479b44475cae3527b9e808ecc69 183AF27ABF7AE61392D03958A7D4CC9D7B37CF30A52DFD2DD9546538FE2E9DB30A49AF7AB7265E56F12E07D12359DDE4456F222E8F135187A095817D4CDE3C66A54AEE91F9F347D076E81C1C6D533CB11BD3193EBDC5E5F711DC42B099559E287A7FA0867AEB830B6CC076A7E6665BBD341BA0E31CBCF3D9A067AD7B4038A1F3BDB3BCE7790E27E2FFF67E5D3518405E37D6A66A76F6E1DBA32DB9A69BDCDE33002627051E1BDBFBF64F6D3FB33EE301139ADA7D03F5F00AC193D3EB05D83198D2EB722848E8ABBC97FE529863E54A098621E6DE5F00DA7BC70DB6FDCD11F9DDE3C33AB15DFBFADD8F8D90E564B2D4DB1E25F5FE28E4D748AD01E42CEE5B30745404C4324C1CC4A421F85C65019B87A9C5CFCCB34D90D45195E28E6E30686D77B4F2F727DB2F583F7137BC0F1D22D59DF897C2B14C77B4C50BA97F88C7CB38B3478FE825970250851A95C9D546D6BB39B265CBBF944F35D0F0924D8D9F4BC05A7D7C55165F81D81B52F0B0BF92D6FDB67C35079B286E0886ACC380C047A031FC6FB5B46DA45D81EBC440CD34229282FDE09FCFCA8E28C0C11DFF664CB486C11BA64A70E73192A66951E206492713173CDDC988515D973E1531155C548E6D8FF5AD623F6C009D2916F1B45E9A0FE80EED21B29A200975EAFAFC982104482A8BEB4DCA45B605E3B2F9984B6E51FEFE86C5B82FC0C9CBA092070450A14D 7FEF3541D25C5F37F46461988729B6EF873D59F35C844B1BFA23D1F257C670FB2E26E6FD5F5162849401E966D1E65EE39FAFB65D1B882F6E3284B1B473B00749F00AA656C8496C9FB09FD62E6D5A09ABA51BB474A63B521A28702A74B24E658065DAA1793D971FD5DD7B433BC9EBBFA1E3B92A4FF35A496740EA9691C1F4A57CAA28213DB2CAEF38E4D94CFEE4102FF34EC669280F0303A24025581E281F4F421917F169329F730B5C62CF68EF3CCEBCDCCE3E9DF78652F1A43E4986B9DE9CC2F7DA5563A34CF417EFD045EF46DAAD8CA3D72E50E4F3B0D4323399AE647DF8A7B9A12E103E0C79A222F798BC9C2317D85929C6E73C96EE03CC63B0FF2F4C94E411B9A6F536AFD7BDBAD279171CD6C39B2018161889A18998BCB92B4D250CD6249F6763BCAF1E03ED12DA38D5D71C79CAAFDB0BA823E702645852D923577F35CC82F59A5AF91B13901042F9AB4CAAD09CFD6226FA4AA92F14D96698E639245BF2F247927EE92466395A16EF31949EBD75428E57D43848E15C66F44E207A69AD301F9CE5826ABFEBCA4927D1BED3331CEEFB9E8C959C97245CB65EDF7EA24F31FC59BC312DA9A3AE81E3C34418ED69FAC2FFAC61D90BE93521633CD10266334F6AE59A69B6B733CE1A6E01D119B91FCAC2571062C0EB2FC79601405D1F349213AED9E9D520DAD50F9FE6E39CE9B96607D6934CBF1C0870F1761A7421BCBCED09D3896012B92281D1E1CB92 4939489ACA4CB1FFE5D096AA9F944746 00 02 12 A3 EA B1 65 D6 81 6C 13 14 13 62 10 53 23 B3 96 85 FF 24 FA CC 46 11 21 24 A4 81 EA 30 63 95 D4 DC BF 9C CC D0 2E DD 5A A6 41 6A 4E 82 65 7D 70 7D 50 09 17 CD 10 55 97 B9 C1 A1 84 F2 A9 AB EA 7D F4 CC 54 E4 64 6E 3A E5 91 A0 06 00 03 01 BB 7B 08 98 A7 49 DE E8 E9 B8 91 52 EC 81 4C C2 39 7B F6 BA 1C 0A B1 95 50 29 BE 02 AD E6 AD 6E 11 3F 20 C4 66 F0 64 22 57 7E E1 06 7A 3B ================================================ FILE: RsaUtilities.cs ================================================ using Mono.Math; namespace Moserware.TlsAnalyzer { /// /// Utility methods for working with the RSA algorithm. /// public static class RsaUtilities { /// /// Performs the RSA operation Result = ^ (mod ). /// /// The message to perform the operation on. /// The exponent value to raise the message by. /// The modulus to divide the results by. /// The value C, such that C = ^ (mod ). public static byte[] PublicKeyOperation(byte[] message, byte[] exponent, byte[] modulus) { var m = new BigInteger(message); var e = new BigInteger(exponent); var n = new BigInteger(modulus); var c = m.ModPow(e, n); var resultBytes = c.GetBytes(); return resultBytes; } // Redundant functions whose name sounds better and have better IntelliSense... /// /// Encrypts a message using the RSA algorithm. /// /// The message to encrypt. /// The public exponent of the recipient. /// The modulus of the recipient. /// The value C, such that C = ^ (mod ). public static byte[] Encrypt(byte[] plainText, byte[] publicExponent, byte[] modulus) { return PublicKeyOperation(plainText, publicExponent, modulus); } /// /// Gets the original signed value using the RSA algorithm. /// /// The encrypted signed value. /// The signer's public key. /// The signer's modulus. /// The value M, such that M = ^ (mod ). public static byte[] GetSignedOriginalValue(byte[] signedValue, byte[] publicExponent, byte[] modulus) { return PublicKeyOperation(signedValue, publicExponent, modulus); } } } ================================================ FILE: Settings.cs ================================================ namespace Moserware.TlsAnalyzer.Properties { // This class allows you to handle specific events on the settings class: // The SettingChanging event is raised before a setting's value is changed. // The PropertyChanged event is raised after a setting's value is changed. // The SettingsLoaded event is raised after the setting values are loaded. // The SettingsSaving event is raised before the setting values are saved. internal sealed partial class Settings { public Settings() { // // To add event handlers for saving and changing settings, uncomment the lines below: // // this.SettingChanging += this.SettingChangingEventHandler; // // this.SettingsSaving += this.SettingsSavingEventHandler; // } private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { // Add code to handle the SettingChangingEvent event here. } private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { // Add code to handle the SettingsSaving event here. } } } ================================================ FILE: TlsAnalyzer.csproj ================================================  Debug AnyCPU 9.0.21022 2.0 {A7697B31-D46D-4701-AF82-FA40CCA788FE} WinExe Properties Moserware.TlsAnalyzer TlsAnalyzer v3.5 512 true full false bin\Debug\ DEBUG;TRACE prompt 4 true pdbonly true bin\Release\ TRACE prompt 4 3.5 3.5 3.5 Form MainForm.cs True True Settings.settings MainForm.cs Designer SettingsSingleFileGenerator Settings.Designer.cs ================================================ FILE: TlsAnalyzer.sln ================================================  Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TlsAnalyzer", "TlsAnalyzer.csproj", "{A7697B31-D46D-4701-AF82-FA40CCA788FE}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{E72B8416-D948-48AF-AA0A-93F08F43500C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {A7697B31-D46D-4701-AF82-FA40CCA788FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A7697B31-D46D-4701-AF82-FA40CCA788FE}.Debug|Any CPU.Build.0 = Debug|Any CPU {A7697B31-D46D-4701-AF82-FA40CCA788FE}.Release|Any CPU.ActiveCfg = Release|Any CPU {A7697B31-D46D-4701-AF82-FA40CCA788FE}.Release|Any CPU.Build.0 = Release|Any CPU {E72B8416-D948-48AF-AA0A-93F08F43500C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E72B8416-D948-48AF-AA0A-93F08F43500C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E72B8416-D948-48AF-AA0A-93F08F43500C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E72B8416-D948-48AF-AA0A-93F08F43500C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal ================================================ FILE: UnitTests/Arc4Tests.cs ================================================ using System.Text; using NUnit.Framework; namespace Moserware.TlsAnalyzer.UnitTests { [TestFixture] public class Arc4Tests { [Test] public void WikipediaTestVectors() { // See http://en.wikipedia.org/wiki/RC4#Test_vectors for 25 May 2009 AssertWikipediaVector("Key", "Plaintext", 0xBB, 0xF3, 0x16, 0xE8, 0xD9, 0x40, 0xAF, 0x0A, 0xD3); AssertWikipediaVector("Wiki", "pedia", 0x10, 0x21, 0xBF, 0x04, 0x20); AssertWikipediaVector("Secret", "Attack at dawn", 0x45, 0xA0, 0x1F, 0x64, 0x5F, 0xC3, 0x5B, 0x38, 0x35, 0x52, 0x54, 0x4B, 0x9B, 0xF5); } private static void AssertWikipediaVector(string key, string plainText, params byte[] expected) { byte[] keyBytes = Encoding.ASCII.GetBytes(key); byte[] result = Encoding.ASCII.GetBytes(plainText); var arc4 = new Arc4(keyBytes); var encryptedResult = arc4.Encrypt(result); CollectionAssert.AreEqual(expected, encryptedResult); } } } ================================================ FILE: UnitTests/BigIntegerTests.cs ================================================ using System; using System.Text; using Mono.Math; using NUnit.Framework; namespace Moserware.TlsAnalyzer.UnitTests { [TestFixture] public class BigIntegerTests { [Test] public void WikipediaSanityChecks() { // http://en.wikipedia.org/wiki/RSA on 25 May 2009 var c = new BigInteger(855); var d = new BigInteger(2753); var n = new BigInteger(3233); var m = c.ModPow(d, n); Assert.AreEqual("123", m.ToString()); } [Test] public void AppliedCryptographySanityChecks() { // Sanity checks from Applied Cryptography, 2nd Edition p467 - 468 var p = new BigInteger(47); var q = new BigInteger(71); var n = p * q; var e = new BigInteger(79); var d = e.ModInverse((p - 1) * (q - 1)); Func encryptor = m => (new BigInteger(m).ModPow(e, n)).ToString(); Assert.AreEqual("1570", encryptor(688)); Assert.AreEqual("2756", encryptor(232)); Assert.AreEqual("2091", encryptor(687)); Assert.AreEqual("2276", encryptor(966)); Assert.AreEqual("2423", encryptor(668)); Assert.AreEqual("158", encryptor(3)); } } } ================================================ FILE: UnitTests/ByteUtilitiesTest.cs ================================================ using NUnit.Framework; namespace Moserware.TlsAnalyzer.UnitTests { [TestFixture] public class ByteUtilitiesTest { [Test] public void ToDisplayByteStringTest() { Assert.AreEqual("01 23 45 67", (new byte[] { 0x01, 0x23, 0x45, 0x67 }).ToDisplayByteString()); Assert.AreEqual("0123 4567", (new byte[] { 0x01, 0x23, 0x45, 0x67}).ToDisplayByteString(2)); Assert.AreEqual("00000000000000000000000001234567", (new byte[] { 0x01, 0x23, 0x45, 0x67 }).ToDisplayByteString(16)); } } } ================================================ FILE: UnitTests/FirefoxSslDebugFileUtilitiesTest.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; using System.Security.Cryptography; namespace Moserware.TlsAnalyzer.UnitTests { [TestFixture] public class FirefoxSslDebugFileUtilitiesTest { [Test] public void GetPremasterSecretKeyTest() { string input = @"5140: SSL[75821480]: Pre-Master Secret [Len: 48] 03 01 97 01 9e aa 3c 3c e1 ef 7f 39 5d be 88 1e ......<<...9]... 60 51 e7 f5 94 db fd 62 b2 b5 26 be b5 3d 7c 16 `Q.....b..&..=|. 4d ff 79 73 8e cb c8 aa 9c 70 f2 5d 29 91 72 50 M.ys.....p.]).rP"; byte[] result = FirefoxSslDebugFileUtilities.GetPremasterSecretKey(input); CollectionAssert.AreEqual(new byte[] { 0x03, 0x01, 0x97, 0x01, 0x9e, 0xaa, 0x3c, 0x3c, 0xe1, 0xef, 0x7f, 0x39, 0x5d, 0xbe, 0x88, 0x1e, 0x60, 0x51, 0xe7, 0xf5, 0x94, 0xdb, 0xfd, 0x62, 0xb2, 0xb5, 0x26, 0xbe, 0xb5, 0x3d, 0x7c, 0x16, 0x4d, 0xff, 0x79, 0x73, 0x8e, 0xcb, 0xc8, 0xaa, 0x9c, 0x70, 0xf2, 0x5d, 0x29, 0x91, 0x72, 0x50 } , result); } } } ================================================ FILE: UnitTests/Prf10Tests.cs ================================================ using System.Security.Cryptography; using System.Text; using NUnit.Framework; namespace Moserware.TlsAnalyzer.UnitTests { [TestFixture] public class Prf10Tests { [Test] public void CheckTestVector() { // Test Vector as defined in // http://www.imc.org/ietf-tls/mail-archive/msg01589.html byte[] secret = new byte[48]; for (int i = 0; i < secret.Length; i++) { secret[i] = 0xab; } string label = "PRF Testvector"; byte[] seed = new byte[64]; for (int i = 0; i < seed.Length; i++) { seed[i] = 0xcd; } int bytesToGenerate = 104; byte[] result = Prf10.GenerateBytes(secret, label, seed, bytesToGenerate); Assert.AreEqual(bytesToGenerate, result.Length); CollectionAssert.AreEqual(result, new byte[] { 0xD3, 0xD4, 0xD1, 0xE3, 0x49, 0xB5, 0xD5, 0x15, 0x04, 0x46, 0x66, 0xD5, 0x1D, 0xE3, 0x2B, 0xAB, 0x25, 0x8C, 0xB5, 0x21, 0xB6, 0xB0, 0x53, 0x46, 0x3E, 0x35, 0x48, 0x32, 0xFD, 0x97, 0x67, 0x54, 0x44, 0x3B, 0xCF, 0x9A, 0x29, 0x65, 0x19, 0xBC, 0x28, 0x9A, 0xBC, 0xBC, 0x11, 0x87, 0xE4, 0xEB, 0xD3, 0x1E, 0x60, 0x23, 0x53, 0x77, 0x6C, 0x40, 0x8A, 0xAF, 0xB7, 0x4C, 0xBC, 0x85, 0xEF, 0xF6, 0x92, 0x55, 0xF9, 0x78, 0x8F, 0xAA, 0x18, 0x4C, 0xBB, 0x95, 0x7A, 0x98, 0x19, 0xD8, 0x4A, 0x5D, 0x7E, 0xB0, 0x06, 0xEB, 0x45, 0x9D, 0x3A, 0xE8, 0xDE, 0x98, 0x10, 0x45, 0x4B, 0x8B, 0x2D, 0x8F, 0x1A, 0xFB, 0xC6, 0x55, 0xA8, 0xC9, 0xA0, 0x13}); var md5 = new MD5CryptoServiceProvider(); var hashedVector = md5.ComputeHash(result); CollectionAssert.AreEqual(new byte[] { 0xCD, 0x7C, 0xA2, 0xCB, 0x9A, 0x6A, 0x3C, 0x6F, 0x34, 0x5C, 0x46, 0x65, 0xA8, 0xB6, 0x81, 0x6B }, hashedVector); } [Test] public void SplitTest() { byte[] deadBeef = new byte[] { 0xDE, 0xAD, 0xBE, 0xEF }; byte[] deadBeefS1; byte[] deadBeefS2; Prf10.Split(deadBeef, out deadBeefS1, out deadBeefS2); CollectionAssert.AreEqual(new byte[] { 0xDE, 0xAD }, deadBeefS1); CollectionAssert.AreEqual(new byte[] { 0xBE, 0xEF }, deadBeefS2); // Get an odd one byte[] firstFive = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 }; byte[] firstFiveS1; byte[] firstFiveS2; Prf10.Split(firstFive, out firstFiveS1, out firstFiveS2); CollectionAssert.AreEqual(new byte[] { 0x01, 0x02, 0x03 }, firstFiveS1); CollectionAssert.AreEqual(new byte[] { 0x03, 0x04, 0x05 }, firstFiveS2); // And an empty one for good measure byte[] empty = new byte[0]; byte[] emptyS1; byte[] emptyS2; Prf10.Split(empty, out emptyS1, out emptyS2); Assert.AreEqual(0, emptyS1.Length); Assert.AreEqual(0, emptyS2.Length); } // HMAC Sanity checks from RFC 2202 [Test] public void HMACMD5SanityCheck() { HMACSanityCheck(new HMACMD5(), 0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03, 0xea, 0xa8, 0x6e, 0x31, 0x0a, 0x5d, 0xb7, 0x38); } [Test] public void HMACSHA1SanityCheck() { HMACSanityCheck(new HMACSHA1(), 0xef, 0xfc, 0xdf, 0x6a, 0xe5, 0xeb, 0x2f, 0xa2, 0xd2, 0x74, 0x16, 0xd5, 0xf1, 0x84, 0xdf, 0x9c, 0x25, 0x9a, 0x7c, 0x79); } private void HMACSanityCheck(HMAC hmac, params byte[] expected) { // test_case = 2 string key = "Jefe"; byte[] keyBytes = Encoding.ASCII.GetBytes(key); string data = "what do ya want for nothing?"; byte[] dataBytes = Encoding.ASCII.GetBytes(data); hmac.Key = keyBytes; byte[] digest = hmac.ComputeHash(dataBytes); CollectionAssert.AreEqual(expected, digest); } } } ================================================ FILE: UnitTests/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("UnitTests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("UnitTests")] [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e6e281d1-4354-4d27-8873-d723ab0f09cc")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: UnitTests/UnitTests.csproj ================================================  Debug AnyCPU 9.0.21022 2.0 {E72B8416-D948-48AF-AA0A-93F08F43500C} Library Properties Moserware.TlsAnalyzer.UnitTests TlsAnalyzer.UnitTests v3.5 512 true full false bin\Debug\ DEBUG;TRACE prompt 4 pdbonly true bin\Release\ TRACE prompt 4 3.5 3.5 3.5 {A7697B31-D46D-4701-AF82-FA40CCA788FE} TlsAnalyzer ================================================ FILE: UnitTests/UnitTests.csproj.user ================================================  Program C:\Program Files (x86)\NUnit 2.5\bin\net-2.0\nunit.exe TlsAnalyzer.UnitTests.dll false ================================================ FILE: UnitTests/WiresharkClipboardUtilitiesTests.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; namespace Moserware.TlsAnalyzer.UnitTests { [TestFixture] public class WiresharkClipboardUtilitiesTests { [Test] public void FromWiresharkTest() { // eg. "160301" var result = "160301".FromWireshark(); CollectionAssert.AreEqual(new byte[] { 0x16, 0x03, 0x01 }, result); } } } ================================================ FILE: WiresharkClipboardUtilities.cs ================================================ using System; using System.Text.RegularExpressions; namespace Moserware.TlsAnalyzer { /// /// Extension methods for working with Wireshark /// public static class WiresharkClipboardUtilities { /// /// Creates a byte array from a string that was created using the copy "Bytes (Hex Stream)" method in Wireshark. /// /// A string that was created using the copy "Bytes (Hex Stream)" method in Wireshark. /// A byte array derived from the hex stream . public static byte[] FromWireshark(this string clipboardValue) { clipboardValue = Regex.Replace(clipboardValue, @"\s", ""); // like "160301" byte[] result = new byte[clipboardValue.Length / 2]; for (int i = 0; i < clipboardValue.Length; i += 2) { string currentStringByte = clipboardValue.Substring(i, 2); byte currentByte = Convert.ToByte(currentStringByte, 16); result[i / 2] = currentByte; } return result; } } } ================================================ FILE: app.config ================================================ 
ABABABABABABABABABABABABABABABAB ABABABABABABABABABABABABABABABAB ABABABABABABABABABABABABABABABAB PRF Testvector CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD 104 Jefe what do ya want for nothing? 4456: SSL[131491792]: Pre-Master Secret [Len: 48] 03 01 bb 7b 08 98 a7 49 de e8 e9 b8 91 52 ec 81 ...{...I.....R.. 4c c2 39 7b f6 ba 1c 0a b1 95 50 29 be 02 ad e6 L.9{......P).... ad 6e 11 3f 20 c4 66 f0 64 22 57 7e e1 06 7a 3b .n.? .f.d"W~..z; 4a2f07cab94fb3067a06567fcec9f737bd5270f7002bb0d6723e551a0d57d982 4a2f07ca986be7a3acdd547d038235895aba467eed6eb07cd46e5e8a199e0c13 0100009a03014a2f07cab94fb3067a06567fcec9f737bd5270f7002bb0d6723e551a0d57d982000044c00ac0140088008700390038c00fc00500840035c007c009c011c0130045004400330032c00cc00ec002c004004100040005002fc008c01200160013c00dc003feff000a0100002d00000013001100000e7777772e616d617a6f6e2e636f6d000a00080006001700180019000b0002010000230000 0200004603014a2f07ca986be7a3acdd547d038235895aba467eed6eb07cd46e5e8a199e0c1320acd07167996609e3584d15c2d43596d8ab93cfa9e899a82aa1652b8ab667a12b000400 0b0009a000099d0004f7308204f3308203dba0030201020210169d041c3130be3d566606f2679ba172300d06092a864886f70d01010505003081b0310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e311f301d060355040b1316566572695369676e205472757374204e6574776f726b313b3039060355040b13325465726d73206f66207573652061742068747470733a2f2f7777772e766572697369676e2e636f6d2f727061202863293035312a302806035504031321566572695369676e20436c61737320332053656375726520536572766572204341301e170d3038303832373030303030305a170d3039303832373233353935395a3067310b3009060355040613025553311330110603550408130a57617368696e67746f6e3110300e0603550407140753656174746c6531183016060355040a140f416d617a6f6e2e636f6d20496e632e311730150603550403140e7777772e616d617a6f6e2e636f6d30819f300d06092a864886f70d010101050003818d0030818902818100c5176d5880046305c91466c7b7f2ed05d6f3f528212f0e829c86dbf35981cd6f5c669aff9e2d93738e795a347501aa7bb90379fc085405827744914d160f2f3ade9a793413eba875e323e5a82ba577b45d0908be25ccd5fd44916971f9a772533d7edffcf7cc84241cc803cd8e5764ea121169c988670e1c28550351a58b2adb0203010001a38201d3308201cf30090603551d1304023000300b0603551d0f0404030205a030440603551d1f043d303b3039a037a0358633687474703a2f2f5356525365637572652d63726c2e766572697369676e2e636f6d2f535652536563757265323030352e63726c30440603551d20043d303b3039060b6086480186f84501071703302a302806082b06010505070201161c68747470733a2f2f7777772e766572697369676e2e636f6d2f727061301d0603551d250416301406082b0601050507030106082b06010505070302301f0603551d230418301680146fecafa0dd8aa4eff52a10672d3f5582bcd7ef25307906082b06010505070101046d306b302406082b060105050730018618687474703a2f2f6f6373702e766572697369676e2e636f6d304306082b060105050730028637687474703a2f2f5356525365637572652d6169612e766572697369676e2e636f6d2f535652536563757265323030352d6169612e636572306e06082b0601050507010c04623060a15ea05c305a305830561609696d6167652f6769663021301f300706052b0e03021a04144b6bb92896060cbbd052389b29ac4b078b21051830261624687474703a2f2f6c6f676f2e766572697369676e2e636f6d2f76736c6f676f312e676966300d06092a864886f70d010105050003820101003feb3eff141d141d684f6d0c571d2c05e0df6161174a949272d043c6d5f20172193abba420fda6f193312c6d8b91ad6a41c993b2f99cf680d3767049d067447c4b43864f91e2c3c2f6f0703f7d3044e77ec83058ce81634773cdcb019301e9189cba318316a793b5f9f5230ff832d2d661f7c05587666cd757052ce5967ec836743aa68b526903d09db325bb8547892d5c924ae3ff3fa9a854d4d84a9b7af7a8cd8237db964c843a876b8385d955d64fcb2aacf40b15e8a06e0491c3bc6892a420d828af09738ff492fc23b9c521d7cff6175fba59cbd0cdd5b9f99876fad5fa98904a2338330336d66906cd196f8b8b173070aef1d14f8c18c38fefc32866730004a03082049c30820405a003020102021075337d9ab0e1233bae2d7de4469162d4300d06092a864886f70d0101050500305f310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e31373035060355040b132e436c6173732033205075626c6963205072696d6172792043657274696669636174696f6e20417574686f72697479301e170d3035303131393030303030305a170d3135303131383233353935395a3081b0310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e311f301d060355040b1316566572695369676e205472757374204e6574776f726b313b3039060355040b13325465726d73206f66207573652061742068747470733a2f2f7777772e766572697369676e2e636f6d2f727061202863293035312a302806035504031321566572695369676e20436c6173732033205365637572652053657276657220434130820122300d06092a864886f70d01010105000382010f003082010a028201010095c321128e40c50d015f765e6694d9732c581922b8c9fc7a39902a77727c1d3ef7d855e3af42cb873002dc5bac70e6b844b42b35eb93d217057ecb46d65c53a032519d746458f90c9a00ea5e44496472f4cd10e2850af934eeb38866a9a5a45ad00e987f580d2b52bb86a97e2efab2487c8ddb2d5f0175a28d063b8bb46107c9be2299f81bd1b55766044d35f4917196b59908259b97c83af320b1dd9e980c4a63b7a6ceb001cef8936af30c6e9fb1e9847b819841e681dc3d2ce7b46be39efc0816d7b3d5b96612997c6d71c84dbec70fe3fb37add57587216b86d044145a547939966956c9b931cd896158e1d9760505adf7b902afa7fd4791a222345a31d10203010001a38201813082017d30120603551d130101ff040830060101ff02010030440603551d20043d303b3039060b6086480186f84501071703302a302806082b06010505070201161c68747470733a2f2f7777772e766572697369676e2e636f6d2f72706130310603551d1f042a30283026a024a0228620687474703a2f2f63726c2e766572697369676e2e636f6d2f706361332e63726c300e0603551d0f0101ff040403020106301106096086480186f842010104040302010630290603551d1104223020a41e301c311a301806035504031311436c617373334341323034382d312d3435301d0603551d0e041604146fecafa0dd8aa4eff52a10672d3f5582bcd7ef253081800603551d2304793077a163a461305f310b300906035504061302555331173015060355040a130e566572695369676e2c20496e632e31373035060355040b132e436c6173732033205075626c6963205072696d6172792043657274696669636174696f6e20417574686f72697479821070bae41d10d92934b638ca7b03ccbabf300d06092a864886f70d010105050003818100c37e08465d9136cf67dcd7a7afafb822c38b0474d3b160bce6feb74412815b3173146356c6722ed11a03435c380a504a4dcddab619a8f4990dafe3f7d8f1752865f66afe9bf4bd52d93fcbda16cba59e2e8e6652783d26fafe9436884a955e2a4c19ef6efa823f2d03efd628b33718cf42b234216447d3206b3a4cdce603900c 0e000000 1000008200808c0863cc016cd036efa22889e1611a8a03304366ebb04da1cb918548e024f488a155cd85030b5bd7e67a9da2019089ceba571100051cafceeff42b3fe630f26e7d55e6d6c80976851da2517e28bf831ebe0bed601c9b00c52ea62238eda3fb7edd689ac2addc2341ba30f0cd95604885ed448e828346c3b71206ae48114eb2da 6a207a41660bd66cf7be3f41ded028c24a612db5301673c1e6317a42222c2f96 4c95745d193fd3d4645d95280a49b80e02d4d479b44475cae3527b9e808ecc69 183AF27ABF7AE61392D03958A7D4CC9D7B37CF30A52DFD2DD9546538FE2E9DB30A49AF7AB7265E56F12E07D12359DDE4456F222E8F135187A095817D4CDE3C66A54AEE91F9F347D076E81C1C6D533CB11BD3193EBDC5E5F711DC42B099559E287A7FA0867AEB830B6CC076A7E6665BBD341BA0E31CBCF3D9A067AD7B4038A1F3BDB3BCE7790E27E2FFF67E5D3518405E37D6A66A76F6E1DBA32DB9A69BDCDE33002627051E1BDBFBF64F6D3FB33EE301139ADA7D03F5F00AC193D3EB05D83198D2EB722848E8ABBC97FE529863E54A098621E6DE5F00DA7BC70DB6FDCD11F9DDE3C33AB15DFBFADD8F8D90E564B2D4DB1E25F5FE28E4D748AD01E42CEE5B30745404C4324C1CC4A421F85C65019B87A9C5CFCCB34D90D45195E28E6E30686D77B4F2F727DB2F583F7137BC0F1D22D59DF897C2B14C77B4C50BA97F88C7CB38B3478FE825970250851A95C9D546D6BB39B265CBBF944F35D0F0924D8D9F4BC05A7D7C55165F81D81B52F0B0BF92D6FDB67C35079B286E0886ACC380C047A031FC6FB5B46DA45D81EBC440CD34229282FDE09FCFCA8E28C0C11DFF664CB486C11BA64A70E73192A66951E206492713173CDDC988515D973E1531155C548E6D8FF5AD623F6C009D2916F1B45E9A0FE80EED21B29A200975EAFAFC982104482A8BEB4DCA45B605E3B2F9984B6E51FEFE86C5B82FC0C9CBA092070450A14D 7FEF3541D25C5F37F46461988729B6EF873D59F35C844B1BFA23D1F257C670FB2E26E6FD5F5162849401E966D1E65EE39FAFB65D1B882F6E3284B1B473B00749F00AA656C8496C9FB09FD62E6D5A09ABA51BB474A63B521A28702A74B24E658065DAA1793D971FD5DD7B433BC9EBBFA1E3B92A4FF35A496740EA9691C1F4A57CAA28213DB2CAEF38E4D94CFEE4102FF34EC669280F0303A24025581E281F4F421917F169329F730B5C62CF68EF3CCEBCDCCE3E9DF78652F1A43E4986B9DE9CC2F7DA5563A34CF417EFD045EF46DAAD8CA3D72E50E4F3B0D4323399AE647DF8A7B9A12E103E0C79A222F798BC9C2317D85929C6E73C96EE03CC63B0FF2F4C94E411B9A6F536AFD7BDBAD279171CD6C39B2018161889A18998BCB92B4D250CD6249F6763BCAF1E03ED12DA38D5D71C79CAAFDB0BA823E702645852D923577F35CC82F59A5AF91B13901042F9AB4CAAD09CFD6226FA4AA92F14D96698E639245BF2F247927EE92466395A16EF31949EBD75428E57D43848E15C66F44E207A69AD301F9CE5826ABFEBCA4927D1BED3331CEEFB9E8C959C97245CB65EDF7EA24F31FC59BC312DA9A3AE81E3C34418ED69FAC2FFAC61D90BE93521633CD10266334F6AE59A69B6B733CE1A6E01D119B91FCAC2571062C0EB2FC79601405D1F349213AED9E9D520DAD50F9FE6E39CE9B96607D6934CBF1C0870F1761A7421BCBCED09D3896012B92281D1E1CB92 4939489ACA4CB1FFE5D096AA9F944746 00 02 12 A3 EA B1 65 D6 81 6C 13 14 13 62 10 53 23 B3 96 85 FF 24 FA CC 46 11 21 24 A4 81 EA 30 63 95 D4 DC BF 9C CC D0 2E DD 5A A6 41 6A 4E 82 65 7D 70 7D 50 09 17 CD 10 55 97 B9 C1 A1 84 F2 A9 AB EA 7D F4 CC 54 E4 64 6E 3A E5 91 A0 06 00 03 01 BB 7B 08 98 A7 49 DE E8 E9 B8 91 52 EC 81 4C C2 39 7B F6 BA 1C 0A B1 95 50 29 BE 02 AD E6 AD 6E 11 3F 20 C4 66 F0 64 22 57 7E E1 06 7A 3B