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