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
  1. Home
  2. General Programming
  3. C#
  4. Rijndael decryption

Rijndael decryption

Scheduled Pinned Locked Moved C#
csharpalgorithmsquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    davidmgray
    wrote on last edited by
    #1

    Hi all, Not a C# or even .net programmer so please bare with me. Can C# use the Rijendeal/AES block cipher without it beiing imported from an ASCI file into a keyring? One of our trading partners is asking to send us files encrypted with the above cipher. The code they use themselves is show below but I'm wondering on how & where I'm to store the key values if not on a keyring. Thanks in advance Dave public string DecodeString(byte[] encodedsource) { System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] bytes = encodedsource; MemoryStream memstream = new MemoryStream(); memstream.Write(bytes, 0, bytes.Length); memstream.Position = 0; SymmetricAlgorithm algorithm = SymmetricAlgorithm.Create("RijnDael"); algorithm.Key = key; algorithm.IV = iv; ICryptoTransform transform = algorithm.CreateDecryptor(); CryptoStream cryptstream = new CryptoStream(memstream, transform, CryptoStreamMode.Read); StreamReader reader = new StreamReader(cryptstream); string returnstring = reader.ReadToEnd(); memstream.Dispose(); reader.Dispose(); cryptstream.Dispose(); return returnstring; }

    D 1 Reply Last reply
    0
    • D davidmgray

      Hi all, Not a C# or even .net programmer so please bare with me. Can C# use the Rijendeal/AES block cipher without it beiing imported from an ASCI file into a keyring? One of our trading partners is asking to send us files encrypted with the above cipher. The code they use themselves is show below but I'm wondering on how & where I'm to store the key values if not on a keyring. Thanks in advance Dave public string DecodeString(byte[] encodedsource) { System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] bytes = encodedsource; MemoryStream memstream = new MemoryStream(); memstream.Write(bytes, 0, bytes.Length); memstream.Position = 0; SymmetricAlgorithm algorithm = SymmetricAlgorithm.Create("RijnDael"); algorithm.Key = key; algorithm.IV = iv; ICryptoTransform transform = algorithm.CreateDecryptor(); CryptoStream cryptstream = new CryptoStream(memstream, transform, CryptoStreamMode.Read); StreamReader reader = new StreamReader(cryptstream); string returnstring = reader.ReadToEnd(); memstream.Dispose(); reader.Dispose(); cryptstream.Dispose(); return returnstring; }

      D Offline
      D Offline
      davidmgray
      wrote on last edited by
      #2

      Forgot describe what the keys look like. I've changed the actual vals for this post. key = ABCDE%^$ABCDE-99 iv = ABCDE$*@ABCDE-99

      T 1 Reply Last reply
      0
      • D davidmgray

        Forgot describe what the keys look like. I've changed the actual vals for this post. key = ABCDE%^$ABCDE-99 iv = ABCDE$*@ABCDE-99

        T Offline
        T Offline
        Trance Junkie
        wrote on last edited by
        #3

        Thats the issue symmetrical ciphers have.Where does one hide the private key. :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

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