Operating System - HP-UX
1828217 Members
1981 Online
109975 Solutions
New Discussion

How does encryption work?

 
SOLVED
Go to solution
Mary Rice
Frequent Advisor

How does encryption work?

Hello Gang,

My 11th grade daughter has to do a presentation next week on the basics of encryption. All the references that I can find are far too advanced for this class. I really need some very simple examples so that we can make some overheads. I don't need anything about simple substitution codes but rather about computer-based encryption.

I'm desparate so please help!!

Thanks, Mary Rice
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: How does encryption work?

Hi Mary:

Rather than embarking on a Web search, I think I'll try this off the top of my head.
Strictly speaking with seem to be talking not about codes but rather about ciphers. If this were me, I would start out with the most fundamental operation first, the exclusive OR (XOR).

---
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0

The idea is that we XOR each character in the plaintext with a machine-generated stream of characters to produced the enciphered text. On the receiving end, the enciphed text is XOR'ed with an identical stream of machine-generated characters and the plaintext emerges. It's really that simple.

To keep things simple, let's encode and decode a sequence of 3-bit characters using a very simple stream of machine-generated characters (1,2,3).

Plaintext:
101 110 111
Machine-generated chars (1,2,3)
001 010 011
XOR'ed enciphered output
100 100 100

This was intentionally chosen to illustrate XOR's. Note that all 3 output values are '100' !.

Now the receiver with start with the enciphered output and apply the same sequence (1,2,3).

Enciphered Text
100 100 100
Machine-generated chars (1,2,3)
001 010 011
XOR'ed plaintext
101 110 111

Note that this is exactly what we started with!

Now the only other topic is this "machine-generated" stream of characters. THIS IN NOT A RANDOM STREAM. In fact, it must not be. The idea, is that the algorithm produces an identical stream based upon identical input paramters. Those input paramters are derived from the "key" that is agreed upon by the sender and the receiver. The two computers can then generate an identical stream od PSEUDORANDOM characters.

That's encrytion 101 in a nutshell.

That should get you and your daughter started, Clay
If it ain't broke, I can fix that.
Uday_S_Ankolekar
Honored Contributor

Re: How does encryption work?

Hello Mary,

You may find details in this link...

http://computer.howstuffworks.com/encryption.htm

Goodluck,
-USA..
Good Luck..
Martin Johnson
Honored Contributor

Re: How does encryption work?

Volker Borowski
Honored Contributor

Re: How does encryption work?

Hi Mary,

well I guess you already tried Google with something like:
encryption basics example simple

Here is one hit i.e.
http://marketing.byu.edu/htmlpages/studentpapers/Encryption1.htm

Do not underestimate the substitution code as an example. It is best to show, why you do NOT do it this way on computers, because they are so fast on trying just by substituting.
I would start with this (everybody understands it, and everybody understands why a computer can crack it so easy)

Second, take an example with a substitution number and an added number from a random-number-sequence-generator.
Everybody understands this as a second aproach.

Insert a small info by introducing random-number-sequence-generator as an important thing in encryption.
I would describe the actual encryption as a black box. It is unimportant HOW it does the encryption. It is more important what it NEEDs to do it (the keys).

Third you could try to decribe a private key encryption (That gets difficult)

Fourth would be public/private key pairs (allthough this would be a hard step).


Good luck
Volker
A. Clay Stephenson
Acclaimed Contributor

Re: How does encryption work?

Hi again Mary:

The only other thing that I would add to my other posting would be a very-simple pseudo RNG.

Something like:
SEED = (SEED * 17117) + 765973;
RAND=SEED MOD 256

Your keys could simply set the SEED value or it could be used to adjust the constants. This is not meant to be a robust pseudo RNG but it should serve the purpose. All operations are assumed to be integer and overflows of the SEED value are expected (and in fact) depended upon.

These two items should give your daughter a very good foundation to illustrate ciphers.

You should also look up references to the German Enigma - which was a cipher but with exploitable flaws. The most serious of which was that a plaintext character could never represent itself. This weakness made machine attacks upon Enigma possible. Whenever a possible soultion found that "A" encoded "A", it had to be wrong.
If it ain't broke, I can fix that.
Chris Wong
Trusted Contributor

Re: How does encryption work?

Hi Mary,

I think if she took the last 2 examples in my SSH paper, that would really show the class. (A picture is worth a thousand words..., or in this case, actually seeing the packets...)

http://newfdawg.com/SHP-SSHpart1.htm

- Chris
Mary Rice
Frequent Advisor

Re: How does encryption work?

Thanks guys. You really are lifesavers! I should have mentioned that this is a Computer Science class so that just talking about encryption was not enough. The teacher wants to see the "nuts and bolts". I want to especially thank Clay for his examples. I could almost see the "lightbulb" over my daughter's head. I had been trying to encode words but when used the simple bit patterns my daughter got it. Perfect!!!

Chris - Thanks to you and we will include your "real world" examples.

You guys are great.

Mary Rice
Mary Rice
Frequent Advisor

Re: How does encryption work?

Hello Gang,

Just as an update, my daughter, Lisa, got an "A". There was only one other "A" in her class. Her teacher especially liked the exclusive or examples. She used the same ones that Clay used. The teacher was very impressed that Lisa somehow chose values that would encrypt to the same value but decrypt to different values. She just said she worked them out backwards.

Thanks to everyone,
Mary Rice