Advice on writing a basic encryption program?

This is a discussion on Advice on writing a basic encryption program? within the C Programming forums, part of the General Programming Boards category; Hello all, Got a bit of the programming "bug" going on, and was just curious as to how difficult it ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    42

    Advice on writing a basic encryption program?

    Hello all,

    Got a bit of the programming "bug" going on, and was just curious as to how difficult it would be to write an encryption/decryption program. I wasn't planning on anything too difficult; my main aim was focusing on - and learning to understand - the encryption process itself, rather than how it functions within larger applications.

    Something basic like the user inputting a string, the string being converted into cipher text and output to file. Then, giving the user the option to reload the file and running a decryption algorithm, so that their original string can be viewed in tact.

    Basically, my question is, do I go about devising the encryption/decryption algorithm myself, as I wouldn't have thought these methods would be divulged, because that'd sort of defeat the object of encryption.

    Let me just clarify, I'm NOT asking for someone to do the algorithm for me, because I quite like the challenge of trying to implement it myself. However, I just wanted to hear the opinions of you guys, as my knowledge in this area is limited.

    Thanks all.

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,682
    There are quite a lot of post related to this thread, a quick search gave me this Encryption

    ssharish

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,334
    Actually, secret algorithms are regarded as a sign of "bad" crypto.
    http://www.interhack.net/people/cmcu...e-oil-faq.html
    All the good algorithms are well published and analysed, as are potential methods of attack.

    You have to assume that the attacker has everything except your key.

    If you're looking for an algorithm to implement, then a lot of people go with something simple like http://en.wikipedia.org/wiki/Caesar_cipher initially. Substituting different algorithms from then on is relatively trivial.

    Coming up with a rock-solid algorithm along the lines of say RSA is not likely.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Writing a Program in C Program
    By LadyLacey in forum C Programming
    Replies: 9
    Last Post: 08-08-2006, 08:47 AM
  2. Guidelines for writing optimal C program
    By Moony in forum C Programming
    Replies: 7
    Last Post: 06-30-2006, 08:08 PM
  3. Simple Encryption Program
    By xamlit in forum C Programming
    Replies: 4
    Last Post: 12-29-2005, 09:03 PM
  4. Encryption program writing
    By Finchie_88 in forum C++ Programming
    Replies: 3
    Last Post: 11-24-2004, 04:32 AM
  5. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 11:39 AM

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