RSS

Rail Fence Cipher

05 Jul

ENCODING

  • The plain text is written downward on successive “Rail” of an imaginary fence, starting a new column when the bottom is reached.
  • The message is then read off in rows

For example, we practice with this message below:

MARK CAMPBELL LEADS CCP112N

  • Converting the message into long letters:

MARKCAMPBELLLEADSCCP112N

I assume that we encode the letters with 2 lines of fence. The total of letters of the message is 24 and we split up into 2 group of equal size (2 lines)

=> Letters are written downward with 2 lines and each line contains 12 letters

M R C M B L L A S C 1 2
A K A P E L E D C P 1 N

Reading off 1st line vertically from left to right

MRCMBLLASC12

continue with 2nd line

AKAPELEDCP1N

Then we will have Cipher text as:

MRCMBLLASC12AKAPELEDCP1N

DECODING

  • Breaking up the letters into groups of equal size
  • Stacking the groups on top of each other
  • writing downward on successive “Rail” of an imaginary fence
Total Size of letters 24 letters
M R C M B L L A S C 1 2 A K A P E L E D C P 1 N

Trying to split the message with 2 lines (or 2 groups) at first place, if we can not understand its meaning, we should continue with more lines such as 3, 4, 5 or more

Splitting up into 2 group of equal size

Group 1 Group 2
M R C M B L L A S C 1 2 A K A P E L E D C P 1 N

Stacking the groups on top of each other

M  R  C  M  B  L  L  A  S  C  1  2
    A  K  A   P  E  L  E  D  C  P  1  N

writing downward on successive “Rail” of an imaginary fence

MARKCAMPBELLEADSCCP112N

The original message will be:

MARK CAMPBELL LEADS CCP112N

We can try with 3 lines (3 groups): MARK CAMPBELL LEADS CCP112N

ENCODING

M    K    M    E    L    D    C    1
   A    C      P     L    E    S     P    2
     R     A     B     L   A    C     1    N

Cipher text will be:

MKMELDC1ACPLESP2RABLAC1N

DECODING

Trying to split the message with 2 lines (or 2 groups) at first place, if we can not understand its meaning, we should continue with more lines such as 3, 4, 5 or more

Spliting up into 2 group of equal size

Group 1 Group 2
M K M E L D C 1 A C P L E S P 2 R A B L A C 1 N

Stacking the groups on top of each other

M K M E L D C 1 A C P L
E S P 2 R A B L A C 1 N

The message that we have is

MEKSMPE2LRDACB1LAACCP1L

The massage can not describe its meaning. so we will try with 3 lines (or 3 groups)

Spliting this ciphertext MKMELDC1ACPLESP2RABLAC1N into 3 groups (8 letters in each group)

Group 1 M K M E L D C 1
Group 2 A C P L E S P 2
Group 3 R A B I A C 1 N

Stacking the groups on top of each other

M K M E L D C 1
A C P L E S P 2
R A B L A C 1 N

writing downward on successive “Rail” of an imaginary fence

MARKCAMPBELLLEADSCCP112N

 

Gửi phản hồi

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Log Out / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Log Out / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Log Out / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Log Out / Thay đổi )

Connecting to %s

 
%d bloggers like this: