Added the beginings of all classes and functions

Nothing is currently implemented
This commit is contained in:
2019-03-31 00:37:49 -04:00
parent f00735648b
commit e057344ead
6 changed files with 345 additions and 0 deletions

45
Atbash.py Normal file
View File

@@ -0,0 +1,45 @@
#PypherStream/Atbash.py
#Matthew Ellison
# Created: 03-30-19
#Modified: 03-30-19
#This file contains the Atbash class for the PypherStream Project.
#This class takes input and uses a Atbash Cipher to encode or decode a message.
#This is a Python port of the CipherStream program found at https://bitbucket.org/Mattrixwv/CipherStream
class Atbash:
__version = "1.0" #The version of the library
def __init__(self):
self.__inputString = "" #Holds the sting that needs encoded or decoded
self.__outputString = "" #Holds the encoded/decoded string
#Decodes inputString and stores in outputString
def __decode(self) -> str:
NotImplemented
#Encodes inputString and stores in outputSting
def __encode(self) -> str:
NotImplemented
#Removes all invalid characters
def __setInputString(self, input: str):
NotImplemented
#Returns the inputString
def getInputString(self) -> str:
NotImplemented
#Returns the outputString
def getOutputString(self) -> str:
NotImplemented
#Takes the input string and encodes it, returning the new message
def encode(self, imput: str) -> str:
NotImplemented
#Takes the input string and decodes it, returning the new message
def decode(self, input: str) -> str:
NotImplemented
#Makes sure all elements are empty
def reset(self):
NotImplemented
#Returns the version of the library
def getVersion(self) -> str:
NotImplemented
#This will run the appropriate commands if this script is called stand alone instead of with the rest of the PypherStream program
if __name__ == "__main__":
NotImplemented

39
Autokey.py Normal file
View File

@@ -0,0 +1,39 @@
#PypherStream/Autokey.py
#Matthew Ellison
# Created: 03-30-19
#Modified: 03-30-19
#This file contains the Autokey class for the PypherStream Project.
#This class takes input and uses a Autokey Cipher to encode or decode a message.
#This is a Python port of the CipherStream program found at https://bitbucket.org/Mattrixwv/CipherStream
from Vigenere import Vigenere
class Autokey(Vigenere):
__version = "1.0" #The version of the library
def __init__(self):
NotImplemented
#Special rules for setting the strings for encoding
def __encodeSet(self, key: str, input: str):
NotImplemented
#Setting the strings for decoding
def __decodeSet(self, key: str, input: str):
NotImplemented
#Decodes the inputString
def __decode(self) -> str:
NotImplemented
#Encodes inputString using the Autokey cipher
def encode(self, key: str, input: str) -> str:
NotImplemented
#Decodes inputString using the Autokey cipher
def decode(self, key: str, input: str) -> str:
NotImplemented
#Returns the version number of the library
@classmethod
def getVersion(self):
NotImplemented
#This will run the appropriate commands if this script is called stand alone instead of with the rest of the PypherStream program
if __name__ == "__main__":
NotImplemented

53
Caesar.py Normal file
View File

@@ -0,0 +1,53 @@
#PypherStream/Caesar.py
#Matthew Ellison
# Created: 03-30-19
#Modified: 03-30-19
#This file contains the Caesar class for the PypherStream Project.
#This class takes input and uses a Caesar Cipher to encode or decode a message.
#This is a Python port of the CipherStream program found at https://bitbucket.org/Mattrixwv/CipherStream
class Caesar:
__version = "1.0" #The current version number for the library
def __init__(self):
self.__inputString = "" #The string that needs encoded/decoded
self.__outputString = "" #The encoded/decoded string
self.__shift = 0 #The amount that you need to shift each letter
#Sets shift and makes sure it is within the propper bounds
def __setShift(self, shiftAmount: int):
NotImplemented
#Sets the input string
def __setInputString(self, inputString: str):
NotImplemented
#Encodes the inputString and stores the result in outputString
def __encode(self) -> str:
NotImplemented
#Decodes the inputString and stores the result in outputString
def __decode(self) -> str:
NotImplemented
#Returns the inputString
def getInputString(self) -> str:
NotImplemented
#Returns the shift value
def getShift(self) -> int:
NotImplemented
#Returns the outputString
def getOutputString(self) -> str:
NotImplemented
#Sets the shift and inputString and encodes the message
def encode(self, shiftAmount: int, input: str) -> str:
NotImplemented
#Sets the shift and inputString and decodes the message
def decode(self, shiftAmount: int, input: str) -> str:
NotImplemented
#Makes sure all of the variables are empty
def reset(self):
NotImplemented
#Returns the version of the library
@classmethod
def getVersion(cls) -> str:
NotImplemented
#This will run the appropriate commands if this script is called stand alone instead of with the rest of the PypherStream program
if __name__ == "__main__":
NotImplemented

50
Morse.py Normal file
View File

@@ -0,0 +1,50 @@
#PypherStream/Morse.py
#Matthew Ellison
# Created: 03-30-19
#Modified: 03-30-19
#This file contains the Morse class for the PypherStream Project.
#This class takes input and uses a Morse Cipher to encode or decode a message.
#This is a Python port of the CipherStream program found at https://bitbucket.org/Mattrixwv/CipherStream
class Morse:
__version = "1.0"
__code = [""] #Holds the Morse representation of the alphanumeric characters
def __init__(self):
self.__inputString = "" #The string that needs encoded/decoded
self.__outputString = "" #The encoded/decoded message
#Encodes inputString snd stores the result in outputString
def __encode(self) -> str:
NotImplemented
#Decodes inputString snd stores the result in outputString
def __decode(self) -> str:
NotImplemented
#Encodes input and returns the result
def __setEncodeInputString(self, input: str):
NotImplemented
#Decodes input and returns the result
def __setDecodeInputString(self, input: str):
NotImplemented
#Returns inputString
def getInputString(self) -> str:
NotImplemented
#Returns outputString
def getOutputString(self) -> str:
NotImplemented
#Encodes input and returns the result
def encode(self, input: str) -> str:
NotImplemented
#Decodes input and returns the result
def decode(self, input: str) -> str:
NotImplemented
#Makes sure all variables are empty
def reset(self):
NotImplemented
#Returns the version of the library
@classmethod
def getVersion(cls) -> str:
NotImplemented
#This will run the appropriate commands if this script is called stand alone instead of with the rest of the PypherStream program
if __name__ == "__main__":
NotImplemented

98
Playfair.py Normal file
View File

@@ -0,0 +1,98 @@
#PypherStream/Playfair.py
#Matthew Ellison
# Created: 03-30-19
#Modified: 03-30-19
#This file contains the Playfair class for the PypherStream Project.
#This class takes input and uses a Playfair Cipher to encode or decode a message.
#This is a Python port of the CipherStream program found at https://bitbucket.org/Mattrixwv/CipherStream
class Playfair:
__replaced = "" #The letter that will need to be replaced in the grid and any input string or keyword
__replacer = "" #The letter that replaced __replaced in any input string or keyword
__doubled = "" #The letter that will be placed between double letters in the input string if necessary or to make the string length even
__version = "1.0" #The current library's version number
__grid: str = [["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""]]
def __init__(self):
self.__inputString = "" #The message that needs to be encoded/decoded
self.__outputString = "" #The encoded/decoded message
self.__keyword = "" #The keyword used to create the grid
#Create the grid from the keyword
def __createGrid(self):
NotImplemented
#Returns true if the letter is found in the grid
def __checkGrid(self, letter: str) -> bool:
NotImplemented
#Searches the grid for letter and sets row & col to its location in grid
def __searchGrid(self, letter: str, row: int, col: int) -> int:
NotImplemented
#Strips invalid characters from the string that needs encoded/decoded
def __setInputString(self, input: str):
NotImplemented
#Strips invalid characters from the keyword and creates the grid
def __setKeyword(self, key: str):
NotImplemented
#Encodes inputString using the PLayfair cipher and stores the results in outputString
def __encode(self) -> str:
NotImplemented
#Decodes inputString using the PLayfair cipher and stores the results in outputString
def __decode(self) -> str:
NotImplemented
#Sets the keyword and inputString and encodes the message
def encode(self, keyword: str, input: str) -> str:
NotImplemented
#Sets the keyword and inputString and decodes the message
def decode(self, keyword: str, input: str) -> str:
NotImplemented
#Returns the keyword used to create the grid
def getKeyword(self) -> str:
NotImplemented
#Returns the string that needs encoded/decoded
def getInputString(self) -> str:
NotImplemented
#Returns the encoded/decoded message
def getOutputString(self) -> str:
NotImplemented
#Returns a string representation of the grid
def getGrid(self) -> str:
NotImplemented
#Makes sure all variables are empty
def reset(self):
NotImplemented
#Allow accessing and modifying of class variables
#Returns the character that needs replaced in messages and the grid
@classmethod
def getReplaced(cls) -> str:
NotImplemented
#Returns the character that replaces the character that needs replaced
@classmethod
def getReplacer(cls) -> str:
NotImplemented
#Returns the character that is added between 2 adjacent characters that are the same
@classmethod
def getDoubled(cls) -> str:
NotImplemented
#Sets the character that needs replaced in messages and the grid
@classmethod
def setReplaced(cls, replaced: str):
NotImplemented
#Sets the character that replaces the character that needs replaced
@classmethod
def setReplacer(cls, replacer: str):
NotImplemented
#Sets the character that is added betwee 2 adjacent characters that are the same
@classmethod
def setDoubled(cls, doubled: str):
NotImplemented
#Returns the current version of the library
@classmethod
def getVersion(cls) -> str:
NotImplemented
#This will run the appropriate commands if this script is called stand alone instead of with the rest of the PypherStream program
if __name__ == "__main__":
NotImplemented

60
Vigenere.py Normal file
View File

@@ -0,0 +1,60 @@
#PypherStream/Vigenere.py
#Matthew Ellison
# Created: 03-30-19
#Modified: 03-30-19
#This file contains the Vigenere class for the PypherStream Project.
#This class takes input and uses a Vigenere Cipher to encode or decode a message.
#This is a Python port of the CipherStream program found at https://bitbucket.org/Mattrixwv/CipherStream
class Vigenere:
__version = "1.0" #The current library's version number
def __init__(self):
self.__inputString = "" #This is the string that you want to encode or decode
self.__outputString = "" #This is the string that is output from encoding or decoding
self.__keyword = "" #This is the keyword that is the resposible for determining the offsets that you change each character by
self.__offset = [] #This holds the offsets computed from each character in the keyword
#Uses keyword to calculate the offset for the Caesar cipher for each character
def __setOffset(self):
NotImplemented
#Sets inputString
def __setInputString(self, input: str):
NotImplemented
#Sets keyword
def __setKeyword(self, key: str):
NotImplemented
#Encodes inputString and stores the result in outputString
def __encode(self) -> str:
NotImplemented
#Decodes inputString and stores the result in outputString
def __decode(self) -> str:
NotImplemented
#Returns the current inputString
def getInputString(self) -> str:
NotImplemented
#Returns the current outputString
def getOutputString(self) -> str:
NotImplemented
#Returns the current keyword
def getKeyword(self) -> str:
NotImplemented
#Returns the current offsets (Used mostly in bug fixing)
def getOffsets(self) -> list:
NotImplemented
#Encodes input using key and returns the result
def encode(self, key: str, input: str) -> str:
NotImplemented
#Decodes input usig key and returns the result
def decode(self, key: str, input: str) -> str:
NotImplemented
#Makes sure all of the variables are empty
def reset(self):
NotImplemented
#Returns the current version of the library
@classmethod
def getVersion(self) -> str:
NotImplemented
#This will run the appropriate commands if this script is called stand alone instead of with the rest of the PypherStream program
if __name__ == "__main__":
NotImplemented