Thread: encryption

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    27

    encryption

    user input - a sentence of up to 80 characters / spaces
    got the user input to work but how do you take the user input and change the order of the characters? and maybe even input a number or ()&%#@ everyonce in a while...

  2. #2
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    I suggest you search google for cryptography, as what you are mentioning would take a hacker 5 seconds to get around.

  3. #3
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Do you know about characters, strings, and the ASCII code?

    If you take an 'A' which has an ASCII value of 65, and add one to it, you'll get a 'B' which has an ASCII value of 66.

    Have you studied bitwise operators? The most common simple encryption technique is to perform a bitwise-exclusive-or with each character and a "key" character. Performing another bitwise-exclusive-or on the result (with the same key) will decrypt the character.

    Note that the above does not "change the order" of the characters, it changes the numeric value of each character... so that it is no longer valid ASCII, and will display as garbage.
    Last edited by DougDbug; 01-14-2004 at 04:37 PM.

  4. #4
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    lol those games in that site kept me busy for 10 mins

  5. #5
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    You can't just mix up plaintext and call that encryption. A cryptosystem must be thought out well enough so that you can decrypt it, for crying out loud.

    Instead of coming up with what you think is cryptography, look up a good cryptosystem and implement it. I suggest you start with a simple Caesar cipher and then move on to Vigenere.
    Last edited by joshdick; 01-14-2004 at 11:32 PM.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  6. #6
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    Originally posted by joshdick
    You can't just mix up plaintext and call that encryption. A cryptosystem must be thought out well enough so that you can decrypt it, for crying out loud.

    Instead of coming up with what you think is cryptography, look up a good cryptosystem and implement it. I suggest you start with a simple Caesar cipher and then move on to Vigenere.
    To piggy back on this suggestion, start with what you are attempting to do, and once you understand it, add some complexity. Work up to learning the more complex systems.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

  7. #7
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Lookup the Handbook of Applied Cryptography on Google. It is available in PDF for free, and may provide a bit of insight for you.

    *edit*
    Forget the search, here's the link: http://www.cacr.math.uwaterloo.ca/hac/

    Anyways, it deals with more modern methods of cryptography, so you should really familiarize yourself with some of the classical simpler methods first.
    Last edited by Zach L.; 01-15-2004 at 08:24 PM.

  8. #8
    Registered User
    Join Date
    Jan 2004
    Posts
    37
    You will need to look into what encryption libraries are available on your system. I suggest that you use the most recent NIST standard for encryption, AES, or the old stand-by 3DES. I don't suggest writing your own encryption algorithms if you really want it to be secure. If you just want to say that you have encrypted something so that no one can read it then use the ol' XOR algorithm.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. help needed with edit control & encryption
    By willc0de4food in forum Windows Programming
    Replies: 2
    Last Post: 03-16-2006, 08:21 PM
  3. abt encryption algorithm
    By purIn in forum C Programming
    Replies: 9
    Last Post: 12-22-2003, 10:16 PM
  4. What's wrong with my Stream Cipher Encryption?
    By Davros in forum C++ Programming
    Replies: 3
    Last Post: 04-18-2002, 09:51 PM
  5. File Encryption & Read/Write in Binary Mode
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 11-30-2001, 06:45 PM