Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Sreerag Gopinath

@Sreerag Gopinath
About
Posts
2
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Customising the SortedArray class
    S Sreerag Gopinath

    Hi, I need to manipulate the 'SortedArray' class in .net so that it allows the entry of the same key more than once. At the same time, it should have all the other properties and methods as it had before. This is crucial to my project. I am totally unfamiliar with overriding the base classes to produce this kind of desired functionality. Could you spare some of your precious time to help me out with the problem ? -Sreerag

    C# help csharp question

  • Help with DES encryption & decryption
    S Sreerag Gopinath

    Hi, Could you spare some time to help me with a small problem? I need to perform encryption and decryption using the DES algorithm. This is the way I want the program to work : My form has 4 textboxes - 1) tbPlaintext --- For the user to enter the plaintext 2) tbCiphertext --- For displaying he ciphertext 3) tbKey --- For displaying the key 4) tbIV --- For displaying the Initialization Vector and 2 buttons - 1) Button1 --- When clicked performs encryption using key form tbKey and the IV from the string - "init vec" 2) Button2 --- When clicked performs decryption using the key in tbKey and the IV "init vec" The user enters the plaintext -"Hello world" and the key - "qwertyui" and clicks the Button1. The ciphertext appears in the textbox tbCiphertext ("SGVsbG8gd29ybGQ="). This part works fine. Now when the user clicks the Button2 , after clearing the text in tbPlaintext, the plaintext "Hello world" should appear in tbPlaintext. But what I get is "U0dWc2JHOGdkMjl5YkdRPQ==". How do you explain that? What should I do to get my original plaintext? The MSDN article "How To: Create an Encryption Library in .NET 1.1" at the following URL helped me with the code- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp Is there something I'm missing? Please help me as soon as possible so I can proceed with my project. - Sreerag Gopinath P C EMAIL : sreerag.gopinath@gmail.com PHONE : +919447489699 ********************************************************* The relevant source code is as follows - ----------------------------------------------- /* ENCRYPT USING DES ALGORITHM */ private void button1_Click(object sender, System.EventArgs e) { if (tbKey.Text == "") MessageBox.Show("Enter some key"); else { if (tbKey.Text.Length == 8) { DES des = new DESCryptoServiceProvider(); des.Mode = CipherMode.CBC; byte[] plaintext = Encoding.ASCII.GetBytes(tbplaintext.Text.ToString()); byte[] key = Encoding.ASCII.GetBytes(tbKey.Text.Trim()); byte[] IV = Encoding.ASCII.GetBytes("init vec"); des.Key = key; des.IV = IV; ICryptoTransform transform = des.CreateEncryptor(des.Key,des.IV); MemoryStream memStreamEncryptedData = new MemoryStream(); memStreamEncryptedData.Write(plaintext,0,plaintext.L

    C# help csharp html com graphics
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups