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. Cryptography

Cryptography

Scheduled Pinned Locked Moved C#
databasequestion
8 Posts 5 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.
  • M Offline
    M Offline
    Mr Perfect
    wrote on last edited by
    #1

    Dear All, Please let meknow how can I encrypt a string and store the encrypted string in database, then reterive the encrypted string and decrypt it. thanx

    B H M R 4 Replies Last reply
    0
    • M Mr Perfect

      Dear All, Please let meknow how can I encrypt a string and store the encrypted string in database, then reterive the encrypted string and decrypt it. thanx

      B Offline
      B Offline
      blackjack2150
      wrote on last edited by
      #2

      Depends on how strong the encryption must be. The easiest and most fun :) way is XOR encryption. I'm sure you'll find plenty of information and examples on the web.

      M 1 Reply Last reply
      0
      • M Mr Perfect

        Dear All, Please let meknow how can I encrypt a string and store the encrypted string in database, then reterive the encrypted string and decrypt it. thanx

        H Offline
        H Offline
        Hari Om Prakash Sharma
        wrote on last edited by
        #3

        plz try this article: http://www.codeproject.com/useritems/Encrypt\_an\_string.asp > use RC2 algoritm

        First and the Foremost: FIGHT TO WIN About Me

        1 Reply Last reply
        0
        • M Mr Perfect

          Dear All, Please let meknow how can I encrypt a string and store the encrypted string in database, then reterive the encrypted string and decrypt it. thanx

          M Offline
          M Offline
          Muammar
          wrote on last edited by
          #4

          I usually develop my own encryption methods, two methods to encode and decode using very basic ways, like getting the integer value of the string, play with it, store it. Do the opposite when retrieving it.


          Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)

          1 Reply Last reply
          0
          • B blackjack2150

            Depends on how strong the encryption must be. The easiest and most fun :) way is XOR encryption. I'm sure you'll find plenty of information and examples on the web.

            M Offline
            M Offline
            Mr Perfect
            wrote on last edited by
            #5

            Just give me a sample

            B 1 Reply Last reply
            0
            • M Mr Perfect

              Just give me a sample

              B Offline
              B Offline
              blackjack2150
              wrote on last edited by
              #6

              Here's you example. A very nice one, too. http://www.eggheadcafe.com/tutorials/aspnet/8b53894c-a889-4914-8c46-122980cc44ae/simple-xor-encryption.aspx[^]

              M 1 Reply Last reply
              0
              • B blackjack2150

                Here's you example. A very nice one, too. http://www.eggheadcafe.com/tutorials/aspnet/8b53894c-a889-4914-8c46-122980cc44ae/simple-xor-encryption.aspx[^]

                M Offline
                M Offline
                Mr Perfect
                wrote on last edited by
                #7

                Thanx for the sample

                1 Reply Last reply
                0
                • M Mr Perfect

                  Dear All, Please let meknow how can I encrypt a string and store the encrypted string in database, then reterive the encrypted string and decrypt it. thanx

                  R Offline
                  R Offline
                  Russell Jones
                  wrote on last edited by
                  #8

                  The biggest problem with crypto is keeping the secret secure. There are plenty of libraries available that will do Rijndael/AES. Including some stuff that ships with .Net I've used the .net libraries a few times in the past, although if i could find a properly peer reviewed open source verison i'd be much happier using it. XOR should only be used for the very lightest crypto requirements, it's very oldhat and can be easily broken. I suppose it depends what you want to do. XOR will hide your girlfriend's phone numbers from your wife but it wouldn't hold up very long against the forces of the RIAA trying to prove that you once looked at a copy of that DVD key. Russell

                  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