Note that there are some explanatory texts on larger screens.

plurals
  1. POC# How to use blowfish in silverlight?
    primarykey
    data
    text
    <p>I had found this free source code in <a href="http://www.broccoliproducts.com/softnotebook/desblowfish/BlowFishCrytography.cs" rel="nofollow">http://www.broccoliproducts.com/softnotebook/desblowfish/BlowFishCrytography.cs</a></p> <p>When I imported it in my project, it gave me some error about</p> <p>The name '_assertBufferMatch' does not exist in the current context</p> <p>The name '_assertBufferMatch' does not exist in the current context</p> <p>The name 'Trace' does not exist in the current context </p> <p>I hadn't modified everything, just rebuild the project, then the error occurred .</p> <p>this error one is</p> <pre><code> public static void Test() { // Declaration of local variables Random rnd = new Random(1); byte[] Key = null; byte[] bufferIn = null; byte[] bufferOut = null; byte[] bufferReturned = null; // Loop through the test vectors for (int iTest = 0; iTest &lt; TestKeys.Length; iTest++) { // Load the key and plain-text Key = BitConverter.GetBytes(TestKeys[iTest]).Reverse().ToArray(); bufferIn = BitConverter.GetBytes(TestPlainText[iTest]).Reverse().ToArray(); // Encrypt with BlowFish BlowFishCrytography.BlowFish(bufferIn, ref bufferOut, Key, true); // Compare with expected result byte[] expectedBufferOut = BitConverter.GetBytes(TestCypherText[iTest]).Reverse().ToArray(); _assertBufferMatch(expectedBufferOut,bufferOut); } // Loop through decrypt-encrypt tests for (int iTest = 0; iTest &lt; 100*1000; iTest++) { // Dump progress if ((iTest % 100) == 0) Trace.TraceInformation("Test {0}", iTest); // Load the key and plain-text Key = CreateBlowFishKey(rnd, MAX_KEY_BYTE_LENGTH); // Create a buffer of data int iLength = rnd.Next(1, 10*1024); _softCreateBuffer(ref bufferIn, iLength); rnd.NextBytes(bufferIn); // Encrypt with BlowFish BlowFishCrytography.BlowFishWithPadding(bufferIn, ref bufferOut, Key, true); // Decrypt with BlowFish BlowFishCrytography.BlowFishWithPadding(bufferOut, ref bufferReturned, Key, false); // Compare buffers _assertBufferMatch(bufferIn, bufferReturned); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload