简体   繁体   中英

C# Public Key verify Perl Private key and use as AES key ? Possible and/or viable?

i was thinking if it is possible and/or viable for obfuscation and security to do as the follow:

  • Client start session with Server (which means a valid login and password was sent and accepted)
  • Server encrypt a random password with it is Private Key that will then be used into a data encryption using Rijndael's method and send both back to the client (The password which is the encrypted random password and the Rijndael's encrypt data which is what we want for the client to work)
  • Client will receive both, verify the password to see wether it was encrypt with our pair of keys or not if so it will be used to decrypt the data.

From what i see, Rijndael has some restrictions as of the password size, so would this be even possible (considering the output of the encrypted random password) ??

Is there antoher approuch that would be close to what i was thinking or trying to describe here ?

Is this even worthed ?

The reason i wanted something like this is mostly to make it harder for anyone trying to reproduce what our server communicates with the client, aside from that we use Smart Assembly. I would like you guys to focus on the questions above and forget about packing my code etc. Think of this as a client / server communication security messure if possible.

Best regards.

I can address the first part. If the server encrypts a key with their private key, ANYONE with their public key will be able to decrypt it. This leaves a gaping hole open for a man-in-the-middle attack. In other words, if I intercept the same token you do, I now know the same key that you know. This means that I can see all the traffic that is going back and forth.

The crux of security has always been this initial key-exchange problem. You may want to employ an industry-standard approach, like Diffie-Helman for the actual key exchange. Hope that helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM