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. Encrypting Problem

Encrypting Problem

Scheduled Pinned Locked Moved C#
sysadminsecuritycryptographyalgorithmsdata-structures
2 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.
  • K Offline
    K Offline
    kingletas
    wrote on last edited by
    #1

    Hey all, Actually i should say that i have a Decrypting problem :-(! I am trying to use a certificate to prove the client/server identity in my application. I was sending a welcome message from the server to the client, encryption/decryption worked smoothly, but this message is just a string like the client number, name of the computer where the server is running and all that... Now when i am doing this: Publisher publisher = new Publisher(new Init().Certificate()); byte[] message = Encoding.ASCII.GetBytes(new Encrypting().Encrypt(new Init().GetRawCertData(), password)); .... and sending it over the "Network", i am getting a bad data exception... something about a wrong character in the Base64 String. I am sending fixed length bytes[] and when i am just sending strings it works. But when i try to change the type of data to send it messes up. My logic to Encrypt/Decrypt is create an instance of the algorithm to use, i use the login password to encrypt/decrypt and i init the key and IV of the algorithm with them, a memory stream and the crypto stream... and return an array of bytes. Maybe i am doing something wrong, any idea of how to use the certificate better, I am extremely new to Certificates and Digital Signatures. I tried SSL Stream but i could not make work :-(. Thanks in advance:-D! Best regards!!!

    Luis E Tineo S

    P 1 Reply Last reply
    0
    • K kingletas

      Hey all, Actually i should say that i have a Decrypting problem :-(! I am trying to use a certificate to prove the client/server identity in my application. I was sending a welcome message from the server to the client, encryption/decryption worked smoothly, but this message is just a string like the client number, name of the computer where the server is running and all that... Now when i am doing this: Publisher publisher = new Publisher(new Init().Certificate()); byte[] message = Encoding.ASCII.GetBytes(new Encrypting().Encrypt(new Init().GetRawCertData(), password)); .... and sending it over the "Network", i am getting a bad data exception... something about a wrong character in the Base64 String. I am sending fixed length bytes[] and when i am just sending strings it works. But when i try to change the type of data to send it messes up. My logic to Encrypt/Decrypt is create an instance of the algorithm to use, i use the login password to encrypt/decrypt and i init the key and IV of the algorithm with them, a memory stream and the crypto stream... and return an array of bytes. Maybe i am doing something wrong, any idea of how to use the certificate better, I am extremely new to Certificates and Digital Signatures. I tried SSL Stream but i could not make work :-(. Thanks in advance:-D! Best regards!!!

      Luis E Tineo S

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Are you still having trouble with this?

      "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

      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