Cryptological Programs

This is a discussion on Cryptological Programs within the C++ Programming forums, part of the General Programming Boards category; I'm using Borland C++. I want to create a basic encryption program. I checked out the XOR thing in the ...

  1. #1
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Question Cryptological Programs

    I'm using Borland C++. I want to create a basic encryption program. I checked out the XOR thing in the tutorials but I don't fully grasp the consept. How would I create a basic key and compare a key to the input... Unless there's a better way than XOR can you explain it?

  2. #2
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Websites

    And also if you know any good tutorials or websites on the topic.

  3. #3
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    The concept of XOR encryption is the following. Let P be the plain text, K be the key and E the encrypted text, then:

    P xor K = E
    E xor K = P

    So you need to create a key, which is a bitstring. This key can be generated by using random value generation or let the user input a string.

    Then you'll need to xor each byte of P with K to get E. And when decoding, you need to xor each byte of E with K to get P.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Recommend upgrade path for C programs
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-22-2007, 07:32 AM
  2. Reroute where programs write to
    By willc0de4food in forum C Programming
    Replies: 7
    Last Post: 09-21-2005, 05:48 PM
  3. POSIX/DOS programs?
    By nickname_changed in forum C++ Programming
    Replies: 1
    Last Post: 02-28-2003, 05:42 AM
  4. executing c++ programs on the web
    By gulti01 in forum C++ Programming
    Replies: 4
    Last Post: 08-12-2002, 04:12 AM
  5. Release MFC Programs & Dynamic MFC DLL :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 05-18-2002, 07:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21