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. better solutions to archieve encryption and decryption of the file

better solutions to archieve encryption and decryption of the file

Scheduled Pinned Locked Moved C#
csssysadminsecuritycryptography
5 Posts 3 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.
  • S Offline
    S Offline
    Shiby
    wrote on last edited by
    #1

    Hi All, Basically, I would like to encrypt the data/file at the client end and should be able to decrypt it at the server side. So that client/end user should not manipulate the auto generated file from the application(window). I've gone through some of the articles from the net and I have found three options to archieve this. 1) Symmetric Adv: Can encrypt and decrypt using key values. Disadv: If the end user decode the manage code then it is possible to identify the key values. Then they can also decrypt the file at their end. 2) Asymmetric Adv: Can encrypt and decrypt using the public and private certificates. 3) Hash algorithum Add and disadv more or less similar to (1). So i prefer to go with point (2), i.e Asymmetric. If anyone has better solutions to archieve encryption and decryption of the file then please let me know. Thanks & Regards, Shiby Chacko

    A G 2 Replies Last reply
    0
    • S Shiby

      Hi All, Basically, I would like to encrypt the data/file at the client end and should be able to decrypt it at the server side. So that client/end user should not manipulate the auto generated file from the application(window). I've gone through some of the articles from the net and I have found three options to archieve this. 1) Symmetric Adv: Can encrypt and decrypt using key values. Disadv: If the end user decode the manage code then it is possible to identify the key values. Then they can also decrypt the file at their end. 2) Asymmetric Adv: Can encrypt and decrypt using the public and private certificates. 3) Hash algorithum Add and disadv more or less similar to (1). So i prefer to go with point (2), i.e Asymmetric. If anyone has better solutions to archieve encryption and decryption of the file then please let me know. Thanks & Regards, Shiby Chacko

      A Offline
      A Offline
      Azraelgod
      wrote on last edited by
      #2

      hi Shiby Way 2 is the only way to prevent the Client from decrypting data, but if you go that far that the user will debug your client he´ll be able to intercept the data after generating and before sending. This is a securityhole you can´t close. If the data you want to send gets larger you should go a middle-way between 1 and 2, because with asymetric encryption you can only encrypt small blocks. (e.g. with rsa 2048 bit you can encrypt 245 byte which will result in 256 encrypted byte). Encrypting with a asymetric algorithm is also slower than a symetric one. The middleway would be then: encrypt everything with a randomly generated symetric key and encrypt only this key asymetric for passing it to the server. Azraelgod

      S 1 Reply Last reply
      0
      • S Shiby

        Hi All, Basically, I would like to encrypt the data/file at the client end and should be able to decrypt it at the server side. So that client/end user should not manipulate the auto generated file from the application(window). I've gone through some of the articles from the net and I have found three options to archieve this. 1) Symmetric Adv: Can encrypt and decrypt using key values. Disadv: If the end user decode the manage code then it is possible to identify the key values. Then they can also decrypt the file at their end. 2) Asymmetric Adv: Can encrypt and decrypt using the public and private certificates. 3) Hash algorithum Add and disadv more or less similar to (1). So i prefer to go with point (2), i.e Asymmetric. If anyone has better solutions to archieve encryption and decryption of the file then please let me know. Thanks & Regards, Shiby Chacko

        G Offline
        G Offline
        GaMBiT_KC
        wrote on last edited by
        #3

        Hi there! Well the most secure thing is to use a hybrid of 1 and 2. In this way you close the security hole of disadv of 1 and make the encryption fast(2..is slow). First of all use Symmetric for the file. As regards the key, you can use asymmetric encryption, so that the client can never get hold of the key value to decrypt! You shall have 3 keys.. 1...which will encrypt the data (symetric key) 2...private key to encrypt symetric key(1) 3...public key to decrypt symetric key(1) In this way the client side, does not know that the encrypted symetric key, is really encrypted. So when he/she tries to decrypt, all he gets is garbage! GaMBiT---> aND ReVeNGe WiLL Be

        S 1 Reply Last reply
        0
        • G GaMBiT_KC

          Hi there! Well the most secure thing is to use a hybrid of 1 and 2. In this way you close the security hole of disadv of 1 and make the encryption fast(2..is slow). First of all use Symmetric for the file. As regards the key, you can use asymmetric encryption, so that the client can never get hold of the key value to decrypt! You shall have 3 keys.. 1...which will encrypt the data (symetric key) 2...private key to encrypt symetric key(1) 3...public key to decrypt symetric key(1) In this way the client side, does not know that the encrypted symetric key, is really encrypted. So when he/she tries to decrypt, all he gets is garbage! GaMBiT---> aND ReVeNGe WiLL Be

          S Offline
          S Offline
          Shiby
          wrote on last edited by
          #4

          Thanks for your response. Is there any other way to archieve the encryption and decryption of file using manage code with security under consideration. Regards, Shiby Chacko

          1 Reply Last reply
          0
          • A Azraelgod

            hi Shiby Way 2 is the only way to prevent the Client from decrypting data, but if you go that far that the user will debug your client he´ll be able to intercept the data after generating and before sending. This is a securityhole you can´t close. If the data you want to send gets larger you should go a middle-way between 1 and 2, because with asymetric encryption you can only encrypt small blocks. (e.g. with rsa 2048 bit you can encrypt 245 byte which will result in 256 encrypted byte). Encrypting with a asymetric algorithm is also slower than a symetric one. The middleway would be then: encrypt everything with a randomly generated symetric key and encrypt only this key asymetric for passing it to the server. Azraelgod

            S Offline
            S Offline
            Shiby
            wrote on last edited by
            #5

            Thanks for your response. Is there any other way to archieve the encryption and decryption of file using manage code with security under consideration. Regards, Shiby Chacko

            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