Make your own free website on Tripod.com

Vigenère Cipher

The Vigenère cipher repeats the chosen key many times over the plaintext. Then, the text is encrypted, using a Vigenère square, according to the key that is written above it, similar to the way Caesar substitution is used.

The following example uses only the parts of the Vigenère square needed to encrypt the messages.

Vigenère square

Plain

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

 

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

 

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

 

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

 

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

 

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

 

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

 

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

Example:

Caesar Substitution:
Key: DDDDDDDDDDDDDDDDDDDDDDDDDD
Plaintext: ABCDEFGHIJKLMNOPQRSTUVWYXZ
Substitution using the key 船': DEFGHIJKLMNOPQRSTUVWXYZABC

Vigenère:

Key: CODECODECODECODECODECODECO
Plaintext: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Substitution using the key 舛': CDEFGHIJKLMNOPQRSTUVWXYZAB
Substitution using the key 前': OPQRSTUVWXYZABCDEFGHIJKLMN
Substitution using the key 船': DEFGHIJKLMNOPQRSTUVWXYZABC
Substitution using the key 薦': EFGHIJKLMNOPQRSTUVWXYZABCD

To encode the message, see the letter of the key which is written above the letter of the plaintext that you want to encrypt. Then match it to the one corresponding to it in the line which starts with the letter of the key that is above the plaintext you want to encrypt.

Example:

Vigenère:
Key: CODECODECODECODECODECODECO
Plaintext: ABCDE F GHIJKLMNOPQRSTUVWXYZ
Substitution using the key 舛': CDEFGHIJKLMNOPQRSTUVWXYZAB
Substitution using the key 前': OPQRSTUVWXYZABCDEFGHIJKLMN
Substitution using the key 船': DEFGHIJKLMNOPQRSTUVWXYZABC
Substitution using the key 薦': EFGHIJKLMNOPQRSTUVWXYZABCD

You want to encrypt the letter F in the plaintext. Look at the letter of the key above it, 前'.

Next, match it to the corresponding letter in the line of the key which is written above the plaintext, 前'.

Key: CODEC O DECODECODECODECODECO
Plaintext: ABCDE F GHIJKLMNOPQRSTUVWXYZ
Substitution using the key 前': OPQRS T UVWXYZABCDEFGHIJKLMN

In the Caesar substitution method, every letter of the key is the same, so it is straight-forward. However, with the Vigenère cipher, more lines of substitution are used, so it complicates the decrypting. However, the message can still be cracked using frequency analysis.

First, scan the encrypted text for repeating segments of more than three words. Then find a common factor for all of them. This decides how long the key is, for example, five. Once you know how long the key is, you can take every fifth letter and decrypt it by using frequency analysis, as with normal substitution.

So, to break this code, a person needs to know how long the key is. Then, it can use frequency analysis to break the code accordingly. To prevent this, the key has to be as long as the message.

If the key is as long as the message and it is not used repeatedly, then the Vigenère cipher would be unbreakable. Frequency analysis can't be used to break this code because it relied on the chance of having the same piece of plaintext being encrypted multiple times using the same part of the keyword, then establish the length of the keyword from that. However, if the keyword was as long as the plaintext and no repeated segments of the keyword are used, then frequency analysis will fail.