0% found this document useful (0 votes)
1 views2 pages

Caesar Cipher Algorithm Steps

The document outlines the steps for the Caesar Cipher algorithm, which involves choosing a shift value, shifting letters in the message accordingly, and replacing them to create an encrypted message. It also explains the Python functions 'ord()' and 'chr()', which convert characters to their Unicode code points and vice versa, respectively. Examples of these functions demonstrate their usage with various characters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views2 pages

Caesar Cipher Algorithm Steps

The document outlines the steps for the Caesar Cipher algorithm, which involves choosing a shift value, shifting letters in the message accordingly, and replacing them to create an encrypted message. It also explains the Python functions 'ord()' and 'chr()', which convert characters to their Unicode code points and vice versa, respectively. Examples of these functions demonstrate their usage with various characters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Caesar Cipher algorithm steps:

Encryption:

1. Choose a shift value:


Select an integer between 1 and 25. This will be the number of positions to shift each
letter.

2. Shift the letters:


For each letter in the message, find its corresponding letter in the alphabet shifted by the
chosen value. If the shift brings you past 'Z', wrap around to the beginning of the alphabet
(e.g., shifting 'X' by 3 would result in 'A').

3. Replace letters:
Substitute each letter in the original message with its shifted counterpart to create the
encrypted message.
Python ord()
Python ord() function takes string argument of a single Unicode character and return its integer Unicode
code point value. Let’s look at some examples of using ord() function.

x = ord('A')
print(x)

print(ord('ć'))
print(ord('ç'))
print(ord('$'))

Output:

65
263
231
36

Python chr()
Python chr() function takes integer argument and return the string representing a character at that code
point.

y = chr(65)
print(y)
print(chr(123))
print(chr(36))

Output:

A
{
$
ć

You might also like