Important alert: (current site time 7/15/2013 5:51:41 PM EDT)
 

winzip icon

A Beginner's Simple Encryption Tutorial / Example

Email
Submitted on: 1/24/2004 7:25:11 AM
By: Adam Boulfoul 
Level: Beginner
User Rating: By 17 Users
Compatibility: C++ (general), Microsoft Visual C++, Borland C++
Views: 44617
author picture
(About the author)
 
     Encrypts and Decrypts a file. This is not an "uncrackable" type of encryption but once you can understand the basics of this type of file encryption you CAN make better ones than me. This is just a quick example of basic encryption. Highly commented to help beginners. There aren't many good examples on PSC, maybe this one is :), to me, comments are more useful than votes. simple Encrypt / Decrypt.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 2 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
1/25/2004 3:46:48 AMHylke Donker

Very cool example
(If this comment was disrespectful, please report it.)

 
1/25/2004 3:51:44 AMAdam Boulfoul

By the way, what I mean by reversing the formula is not just "+" to "-" and "*" to "/". For example if your encryption formula is "Byte + (Byte - 3)" then your decryption forumla must be "(Byte + 3) - Byte" not "Byte - (Byte + 3)".
(If this comment was disrespectful, please report it.)

 
7/27/2004 2:03:40 AM

nice program, very well documented
(If this comment was disrespectful, please report it.)

 
10/9/2004 3:36:55 PM

cool tutorial...would love to see a more advanced encryption one from you. I'm sure you'd make it easy to understand
(If this comment was disrespectful, please report it.)

 
1/12/2005 6:26:01 PM

thanks for posting this its really helpful
(If this comment was disrespectful, please report it.)

 
4/13/2005 10:41:55 AM

you are what we call, a good teacher.
after i read your very easy to understand code, then i modified it with dialog based program with VC++6

thanks a lot.
(If this comment was disrespectful, please report it.)

 
4/27/2006 5:03:01 PMWilliam

I am having trouble getting this to run. Any advice?
(If this comment was disrespectful, please report it.)

 
8/23/2006 4:18:10 AMHadi

it's realy cool and easy to understand.. i'm waiting for your compression example! :)
(If this comment was disrespectful, please report it.)

 
4/26/2007 9:40:36 AMJagan

Thank u sir...
(If this comment was disrespectful, please report it.)

 
5/19/2007 3:16:29 PMzzz

Very Nice Tutorial
(If this comment was disrespectful, please report it.)

 
11/14/2007 12:31:03 PM

Thumbs up to you your excellent commenting and presentation (like even the about basics)...Well Done!
(If this comment was disrespectful, please report it.)

 
6/27/2010 6:28:29 AMSlaven

Thatnk you . Im just starting out programming. I love this example now i understand it more.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.