good encryption/decryption algorithm

This is a discussion on good encryption/decryption algorithm within the C Programming forums, part of the General Programming Boards category; hi all, I am currently looking for a small, secure, and reliable method of encrypting and decrypting strings. I have ...

  1. #1
    Madly in anger with you
    Join Date
    Nov 2005
    Posts
    211

    good encryption/decryption algorithm

    hi all,
    I am currently looking for a small, secure, and reliable method of encrypting and decrypting strings. I have a link to one at codeproject, but some users have posted that it is not very reliable.

    it will be used to encrypt/decrypt network traffic. it doesn't have to be un-crackable, just not TOO easily crackable. its not like it will be protecting super sensitive government data or anything, not protecting anything really important. reliability and usability is key here, I don't need some rock solid algorithm.

    another thing that I am looking for, is the algorithm should not add anything to the encrypted string if possible. I have been fooling with a base64 algo which adds characters to the crypted string. this isn't really important, but if possible I would like to find one that keeps the string size to a minimum (or doesn't affect it at all).

    if anyone has any recommendations or suggestions, I would be happy to hear them .

    thankyou in advance!

    Intel Core 2 Quad Q6600 @ 2.40 GHz
    3072 MB PC2-5300 DDR2
    2 x 320 GB SATA (640 GB)
    NVIDIA GeForce 8400GS 256 MB PCI-E

  2. #2
    Registered User vinit's Avatar
    Join Date
    Apr 2006
    Location
    India
    Posts
    39
    I know very simple & yet effective algorithm,
    Just Ex-Or input with known string & result will be encrypted string, on reception again Ex-or with same string to get original string.
    U can Ex-or it no. of times each time with seperate string for additional safty.

  3. #3
    Mad OnionKnight's Avatar
    Join Date
    Jan 2005
    Location
    Umeň, Sweden
    Posts
    555
    Blowfish?

  4. #4
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Check the "code snippits" section of this website, there is a simple XOR encryption example there.

    oh, and btw: Base64 encoding is an encoding, not and encryption. If your really worried about security you should check the difference

  5. #5
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    Quote Originally Posted by vinit
    I know very simple & yet effective algorithm,
    Just Ex-Or input with known string & result will be encrypted string, on reception again Ex-or with same string to get original string.
    U can Ex-or it no. of times each time with seperate string for additional safty.
    This is utter nonsense. First of all, xor is for all practical purposes trivial to break. Second, applying xor multiple times does hardly anything for security - if the lengths of two strings are X and Y, it makes the effective length of the string lcm(X, Y), but does so in a manner that is more open to attack than a single random key of length lcm(X, Y). Third, if the strings sent follow any regular format, that will show in the encryption, and key length won't matter that much anyway, if every message uses the same key.

    Edit:
    Quote Originally Posted by Perspective
    Check the "code snippits" section of this website, there is a simple XOR encryption example there.
    No, don't!
    There are 10 types of people in this world, those who cringed when reading the beginning of this sentence and those who salivated to how superior they are for understanding something as simple as binary.

  6. #6
    Registered User vinit's Avatar
    Join Date
    Apr 2006
    Location
    India
    Posts
    39
    Well
    Originally Posted by Rashakil Fol
    This is utter nonsense
    was really unnecessary.Im not master of all here,that was my opinion.Anyways Thanks for ur answer on Ex_oring. However I guess encryption are not done by single key all time,until & unless its shared,symmetric key algorithms.
    I dont have adaquate knowledge of encryption with Ex-Oring ,thanks for updating it.Yes even Im agree that applying xor multiple times does hardly anything for security. However
    if the lengths of two strings are X and Y, it makes the effective length of the string lcm(X, Y), but does so in a manner that is more open to attack than a single random key of length lcm(X, Y)
    I ain't got this but I was thinking of Ex-Oring X by Y,where X will be divided in length(Y) parts so that effective string will be same as input string
    Thanks & Regards
    Vinit.

  7. #7
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    Quote Originally Posted by vinit
    Well
    was really unnecessary.Im not master of all here,that was my opinion.
    That was not unnecessary, and your statement being your opinion is no excuse for your statement being incorrect, in fact, harmful.
    There are 10 types of people in this world, those who cringed when reading the beginning of this sentence and those who salivated to how superior they are for understanding something as simple as binary.

  8. #8
    Registered User vinit's Avatar
    Join Date
    Apr 2006
    Location
    India
    Posts
    39
    We are certainly not here for arguements,wll If I've said someting which is not right , then u can say "it was wrong" that will do,No need to use harsh words.Anyways thanks for correcting me,I've nothing to say more on this.Lets be friends instead .

    Thanks & Regards
    Vinit.

  9. #9
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    Well, to get back on subject, I work with a very popular commercial security controller hardware which is network accessible. This hardware uses the Electronic Code Book implementation of the AES (Rijndael) algorithm for network communication.

    IMHO, AES ECB is easy to work with, yet provides a high level of security.

    AES (Rijndael) example

  10. #10
    Madly in anger with you
    Join Date
    Nov 2005
    Posts
    211
    thanks for all the replies!

    I've read about AES before and about it being a secure algorithm. I have checked out the link you posted BobS0327 and AES ECB seems pretty easy and after some testing I think it is just what I am looking for.

    Intel Core 2 Quad Q6600 @ 2.40 GHz
    3072 MB PC2-5300 DDR2
    2 x 320 GB SATA (640 GB)
    NVIDIA GeForce 8400GS 256 MB PCI-E

  11. #11
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    Use cryptoAPI or a similar library, don't implement your own encryption or re-write an existing encryption algorithm unless you know what you're doing.

  12. #12
    Madly in anger with you
    Join Date
    Nov 2005
    Posts
    211
    I can't find cryptoAPI, but would be interested in taking a look at it, if it can save me time and size. do you have a link to where I can find cryptoAPI or a similar lib Brian and if so could you please post it?
    Last edited by Bleech; 04-18-2006 at 04:18 PM.

    Intel Core 2 Quad Q6600 @ 2.40 GHz
    3072 MB PC2-5300 DDR2
    2 x 320 GB SATA (640 GB)
    NVIDIA GeForce 8400GS 256 MB PCI-E

  13. #13
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    Quote Originally Posted by sl34k
    I can't find cryptoAPI, but would be interested in taking a look at it, if it can save me time and size. do you have a link to where I can find cryptoAPI or a similar lib Brian and if so could you please post it?
    Here's a bunch:
    http://www.homeport.org/~adam/crypto/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Good Programming schools are they out there???
    By jbarby in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 05-12-2009, 06:31 PM
  2. linked list recursive function spaghetti
    By ... in forum C++ Programming
    Replies: 4
    Last Post: 09-02-2003, 02:53 PM
  3. Database Search Algorithm
    By Krupux in forum C Programming
    Replies: 1
    Last Post: 08-28-2003, 09:57 PM
  4. Algorithm question
    By PJYelton in forum C++ Programming
    Replies: 2
    Last Post: 10-28-2002, 09:52 AM
  5. string searching algorithm......help
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 12-07-2001, 08:59 AM

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