the rail fence

10
What is this line doing? What are the two 26s for?

Upload: grahamwell

Post on 01-Dec-2014

231 views

Category:

Business


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: The rail fence

What is this line doing?

What are the two 26s for?

Page 2: The rail fence

This is where we use the ApplyShifttoASCIICodeForCharacter functionTo get the encrypted text.

How do we decrypt?

Page 3: The rail fence

The “rail fence”

T t a Jh i h r M oi s e m r ns y e s

Size = 4

Page 4: The rail fence

The “rail fence”

T t a Jh i h r M oi s e m r ns y e s

Size = 4

Page 5: The rail fence

The “rail fence”

T

h

i

s

i

s

t

h

e

a

r

m

y

M

r

J

o

n

e

s

Size = 4

Page 6: The rail fence

The “rail fence”

T t a J

h i h r M o

i s e m r n

s y e

s

Size = 4

Page 7: The rail fence

How the algorithm works

2 Counters

T t a Jh i h r M oi s e m r ns y e s

Counter one starts at the beginning and loops once only

Counter two starts at counter one and loops to the end

Page 8: The rail fence

T t a Jh i h r M oi s e m r ns y e s

Page 9: The rail fence

T t a J

h i h r M oi s e m r ns y e

s

For Count1 = 1 To SizeOfRailFence

While Count2 < OriginalText.Length Count2 = Count2 + SizeOfRailFence

Page 10: The rail fence