Skip to content

create beaufort cipher #3206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 17, 2020
6 changes: 3 additions & 3 deletions ciphers/beaufort_cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
# equal to the length of original text
def generate_key(message: str, key: str) -> str:
"""
>>> generate_key("THE GERMAN ATTACK","SECRET")
>>> generate_key('THE GERMAN ATTACK','SECRET')
SECRETSECRETSECRE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>>> generate_key('THE GERMAN ATTACK','SECRET')
SECRETSECRETSECRE
>>> generate_key("THE GERMAN ATTACK", "SECRET")
'SECRETSECRETSECRE'

"""
x = len(message)
Expand All @@ -85,7 +85,7 @@ def generate_key(message: str, key: str) -> str:
# generated with the help of the key
def cipherText(message: str, key_new: str) -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def cipherText(message: str, key_new: str) -> str:
def cipher_text(message: str, key_new: str) -> str:

"""
>>> cipherText("THE GERMAN ATTACK","SECRETSECRETSECRE")
>>> cipherText('THE GERMAN ATTACK','SECRETSECRETSECRE')
BDC PAYUWL JPAIYI
"""
cipher_text = ""
Expand All @@ -104,7 +104,7 @@ def cipherText(message: str, key_new: str) -> str:
# and returns the original text
def originalText(cipher_text: str, key_new: str) -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def originalText(cipher_text: str, key_new: str) -> str:
def original_text(cipher_text: str, key_new: str) -> str:

"""
>>> originalText("BDC PAYUWL JPAIYI","SECRETSECRETSECRE")
>>> originalText('BDC PAYUWL JPAIYI','SECRETSECRETSECRE')
THE GERMAN ATTACK
"""
or_txt = ""
Expand Down