Download - The rail fence
Transcript
![Page 1: The rail fence](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/1.jpg)
What is this line doing?
What are the two 26s for?
![Page 2: The rail fence](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/2.jpg)
This is where we use the ApplyShifttoASCIICodeForCharacter functionTo get the encrypted text.
How do we decrypt?
![Page 3: The rail fence](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/3.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/4.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/5.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/6.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/7.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/8.jpg)
T t a Jh i h r M oi s e m r ns y e s
![Page 9: The rail fence](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/9.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022082623/547dd43ab4795989508b4a29/html5/thumbnails/10.jpg)