path
stringlengths 9
117
| type
stringclasses 2
values | project
stringclasses 10
values | commit_hash
stringlengths 40
40
| commit_message
stringlengths 1
137
| ground_truth
stringlengths 0
2.74k
| main_code
stringlengths 102
3.37k
| context
stringlengths 0
14.7k
|
---|---|---|---|---|---|---|---|
app.Decryptor.basicEncryption.viginere/Viginere.decrypt | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <0>:<add> result = self.hackVigenere(text)
<del> result = hackVigenere(text)
<1>:<del> print(result)
<5>:<add> return result
<del> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
<0> result = hackVigenere(text)
<1> print(result)
<2> if result['IsPlaintext?']:
<3> return result
<4> else:
<5> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
<6>
| ===========unchanged ref 0===========
at: re
compile(pattern: AnyStr, flags: _FlagsType=...) -> Pattern[AnyStr]
compile(pattern: Pattern[AnyStr], flags: _FlagsType=...) -> Pattern[AnyStr]
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
+ self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ self.SILENT_MODE = True # If set to True, program doesn't print anything.
+ self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
+ self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
+
self.lc = lc
- self.MAX_KEY_LENGTH = 16
- self.self.NONself.LETTERS_PATTERN = re.compile('[^A-Z]')
- self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- self.analysis = ""
===========changed ref 1===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.primeNum
+
+
===========changed ref 2===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.detectEnglish
+
+
===========changed ref 3===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.cryptomath
+
+
===========changed ref 4===========
+ # module: app.Decryptor.basicEncryption.freqAnalysis
+
+
===========changed ref 5===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.rabinMiller
+
+
===========changed ref 6===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.freqAnalysis
+
+
===========changed ref 7===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+ # Exceptions
+ class PyperclipException(RuntimeError):
+ pass
+
===========changed ref 8===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.addNumbers
+ def addNumbers(a, b):
+ return a + b
+
===========changed ref 9===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.viginere
+ class Viginere:
+
+
+ def getItemAtIndexOne(self, items):
+ return items[1]
+
===========changed ref 10===========
+ # module: app.Decryptor.basicEncryption.freqAnalysis
+
+
+ def getItemAtIndexZero(items):
+ return items[0]
+
===========changed ref 11===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.freqAnalysis
+
+
+ def getItemAtIndexZero(items):
+ return items[0]
+
===========changed ref 12===========
# module: app.mathsHelper
class mathsHelper:
+
+
+ def getItemAtIndexZero(self, items):
+ return items[0]
+
===========changed ref 13===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.passingReference
+ def eggs(someParameter):
+ someParameter.append('Hello')
+
===========changed ref 14===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.affineHacker
+
+ SILENT_MODE = False
+
===========changed ref 15===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.simpleSubDictionaryHacker
+
+ SILENT_MODE = False
+
===========changed ref 16===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.detectEnglish
+
+ ENGLISH_WORDS = loadDictionary()
+
===========changed ref 17===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+
+ # Windows-related clipboard functions:
+ class CheckedCall(object):
+
+ def __setattr__(self, key, value):
+ setattr(self.f, key, value)
+
===========changed ref 18===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereCipher
+
+
+ def decryptMessage(key, message):
+ return translateMessage(key, message, 'decrypt')
+
===========changed ref 19===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereCipher
+
+
+ def encryptMessage(key, message):
+ return translateMessage(key, message, 'encrypt')
+
===========changed ref 20===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.viginere
+ class Viginere:
+ def decryptMessage(self, key, message):
+ return self.translateMessage(key, message, 'decrypt')
+
===========changed ref 21===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.simpleSubDictionaryHacker
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 22===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.transpositionHacker
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 23===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereDictionaryHacker
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 24===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+
+ # Windows-related clipboard functions:
+ class CheckedCall(object):
+ def __init__(self, f):
+ super(CheckedCall, self).__setattr__("f", f)
+
===========changed ref 25===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.makeWordPatterns
+
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 26===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.addNumbers
+
+ spam = addNumbers(2, 40)
+ print(spam)
+
===========changed ref 27===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereCipher
+
+ LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+
===========changed ref 28===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+ def is_available():
+ return copy != lazy_load_stub_copy and paste != lazy_load_stub_paste
+
===========changed ref 29===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.passingReference
+ spam = [1, 2, 3]
+ eggs(spam)
+ print(spam)
+
===========changed ref 30===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.helloFunction
+ print('Start!')
+ hello()
+ print('Call it again.')
+ hello()
+ print('Done.')
+
===========changed ref 31===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.helloFunction
+ def hello():
+ print('Hello!')
+ total = 42 + 1
+ print('42 plus 1 is %s' % (total))
+
===========changed ref 32===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+ class PyperclipWindowsException(PyperclipException):
+ def __init__(self, message):
+ message += " (%s)" % ctypes.WinError()
+ super(PyperclipWindowsException, self).__init__(message)
+
===========changed ref 33===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.transpositionFileHacker
+
+ inputFilename = 'frankenstein.encrypted.txt'
+ outputFilename = 'frankenstein.decrypted.txt'
+
===========changed ref 34===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+ def _executable_exists(name):
+ return subprocess.call([WHICH_CMD, name],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0
+ |
app.Decryptor.basicEncryption.viginere/Viginere.findRepeatSequencesSpacings | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <0>:<del>
<3>:<add> # values of a list of spacings (num of letters between the repeats).
<del> # values of a list of spacings (num of self.LETTERS between the repeats).
<4>:<add>
<del>
<5>:<add> # Use a regular expression to remove non-letters from the message:
<del> # Use a regular expression to remove non-self.LETTERS from the message:
<6>:<add> message = self.NONLETTERS_PATTERN.sub('', message.upper())
<del> message = self.NONself.LETTERS_PATTERN.sub('', message.upper())
<7>:<add>
<del>
<14>:<add>
<del>
<21>:<add>
<del>
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
def findRepeatSequencesSpacings(self, message):
<0>
<1> # Goes through the message and finds any 3 to 5 letter sequences
<2> # that are repeated. Returns a dict with the keys of the sequence and
<3> # values of a list of spacings (num of self.LETTERS between the repeats).
<4>
<5> # Use a regular expression to remove non-self.LETTERS from the message:
<6> message = self.NONself.LETTERS_PATTERN.sub('', message.upper())
<7>
<8> # Compile a list of seqLen-letter sequences found in the message:
<9> seqSpacings = {} # Keys are sequences, values are lists of int spacings.
<10> for seqLen in range(3, 6):
<11> for seqStart in range(len(message) - seqLen):
<12> # Determine what the sequence is, and store it in seq:
<13> seq = message[seqStart:seqStart + seqLen]
<14>
<15> # Look for this sequence in the rest of the message:
<16> for i in range(seqStart + seqLen, len(message) - seqLen):
<17> if message[i:i + seqLen] == seq:
<18> # Found a repeated sequence.
<19> if seq not in seqSpacings:
<20> seqSpacings[seq] = [] # Initialize a blank list.
<21>
<22> # Append the spacing distance between the repeated
<23> # sequence and the original sequence:
<24> seqSpacings[seq].append(i - seqStart)
<25> return seqSpacings
<26>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.viginere.Viginere
hackVigenere(self, ciphertext)
hackVigenere(ciphertext)
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
at: typing.Pattern
flags: int
groupindex: Mapping[str, int]
groups: int
pattern: AnyStr
sub(repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int=...) -> AnyStr
sub(repl: AnyStr, string: AnyStr, count: int=...) -> AnyStr
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
+ result = self.hackVigenere(text)
- result = hackVigenere(text)
- print(result)
if result['IsPlaintext?']:
return result
else:
+ return result
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
+ self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ self.SILENT_MODE = True # If set to True, program doesn't print anything.
+ self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
+ self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
+
self.lc = lc
- self.MAX_KEY_LENGTH = 16
- self.self.NONself.LETTERS_PATTERN = re.compile('[^A-Z]')
- self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- self.analysis = ""
===========changed ref 2===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.primeNum
+
+
===========changed ref 3===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.detectEnglish
+
+
===========changed ref 4===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.cryptomath
+
+
===========changed ref 5===========
+ # module: app.Decryptor.basicEncryption.freqAnalysis
+
+
===========changed ref 6===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.rabinMiller
+
+
===========changed ref 7===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.freqAnalysis
+
+
===========changed ref 8===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+ # Exceptions
+ class PyperclipException(RuntimeError):
+ pass
+
===========changed ref 9===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.addNumbers
+ def addNumbers(a, b):
+ return a + b
+
===========changed ref 10===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.viginere
+ class Viginere:
+
+
+ def getItemAtIndexOne(self, items):
+ return items[1]
+
===========changed ref 11===========
+ # module: app.Decryptor.basicEncryption.freqAnalysis
+
+
+ def getItemAtIndexZero(items):
+ return items[0]
+
===========changed ref 12===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.freqAnalysis
+
+
+ def getItemAtIndexZero(items):
+ return items[0]
+
===========changed ref 13===========
# module: app.mathsHelper
class mathsHelper:
+
+
+ def getItemAtIndexZero(self, items):
+ return items[0]
+
===========changed ref 14===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.passingReference
+ def eggs(someParameter):
+ someParameter.append('Hello')
+
===========changed ref 15===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.affineHacker
+
+ SILENT_MODE = False
+
===========changed ref 16===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.simpleSubDictionaryHacker
+
+ SILENT_MODE = False
+
===========changed ref 17===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.detectEnglish
+
+ ENGLISH_WORDS = loadDictionary()
+
===========changed ref 18===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+
+ # Windows-related clipboard functions:
+ class CheckedCall(object):
+
+ def __setattr__(self, key, value):
+ setattr(self.f, key, value)
+
===========changed ref 19===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereCipher
+
+
+ def decryptMessage(key, message):
+ return translateMessage(key, message, 'decrypt')
+
===========changed ref 20===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereCipher
+
+
+ def encryptMessage(key, message):
+ return translateMessage(key, message, 'encrypt')
+
===========changed ref 21===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.viginere
+ class Viginere:
+ def decryptMessage(self, key, message):
+ return self.translateMessage(key, message, 'decrypt')
+
===========changed ref 22===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.simpleSubDictionaryHacker
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 23===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.transpositionHacker
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 24===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereDictionaryHacker
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 25===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+
+ # Windows-related clipboard functions:
+ class CheckedCall(object):
+ def __init__(self, f):
+ super(CheckedCall, self).__setattr__("f", f)
+
===========changed ref 26===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.makeWordPatterns
+
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 27===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.addNumbers
+
+ spam = addNumbers(2, 40)
+ print(spam)
+
===========changed ref 28===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereCipher
+
+ LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+
===========changed ref 29===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+ def is_available():
+ return copy != lazy_load_stub_copy and paste != lazy_load_stub_paste
+
===========changed ref 30===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.passingReference
+ spam = [1, 2, 3]
+ eggs(spam)
+ print(spam)
+
===========changed ref 31===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.helloFunction
+ print('Start!')
+ hello()
+ print('Call it again.')
+ hello()
+ print('Done.')
+ |
app.Decryptor.basicEncryption.viginere/Viginere.getUsefulFactors | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <0>:<del> # Will not attempt keys longer than this.
<2>:<add> # less than MAX_KEY_LENGTH + 1 and not 1. For example,
<del> # less than self.MAX_KEY_LENGTH + 1 and not 1. For example,
<4>:<add>
<del>
<7>:<add>
<del>
<9>:<add>
<del>
<11>:<add> # MAX_KEY_LENGTH.
<del> # self.MAX_KEY_LENGTH.
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getUsefulFactors(self, num):
<0> # Will not attempt keys longer than this.
<1> # Returns a list of useful factors of num. By "useful" we mean factors
<2> # less than self.MAX_KEY_LENGTH + 1 and not 1. For example,
<3> # getUsefulFactors(144) returns [2, 3, 4, 6, 8, 9, 12, 16]
<4>
<5> if num < 2:
<6> return [] # Numbers less than 2 have no useful factors.
<7>
<8> factors = [] # The list of factors found.
<9>
<10> # When finding factors, you only need to check the integers up to
<11> # self.MAX_KEY_LENGTH.
<12> for i in range(2, self.MAX_KEY_LENGTH + 1): # Don't test 1: it's not useful.
<13> if num % i == 0:
<14> factors.append(i)
<15> otherFactor = int(num / i)
<16> if otherFactor < self.MAX_KEY_LENGTH + 1 and otherFactor != 1:
<17> factors.append(otherFactor)
<18> return list(set(factors)) # Remove duplicate factors.
<19>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.viginere.Viginere.findRepeatSequencesSpacings
message = self.NONLETTERS_PATTERN.sub('', message.upper())
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
+ result = self.hackVigenere(text)
- result = hackVigenere(text)
- print(result)
if result['IsPlaintext?']:
return result
else:
+ return result
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
+ self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ self.SILENT_MODE = True # If set to True, program doesn't print anything.
+ self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
+ self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
+
self.lc = lc
- self.MAX_KEY_LENGTH = 16
- self.self.NONself.LETTERS_PATTERN = re.compile('[^A-Z]')
- self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- self.analysis = ""
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
def findRepeatSequencesSpacings(self, message):
-
# Goes through the message and finds any 3 to 5 letter sequences
# that are repeated. Returns a dict with the keys of the sequence and
+ # values of a list of spacings (num of letters between the repeats).
- # values of a list of spacings (num of self.LETTERS between the repeats).
+
-
+ # Use a regular expression to remove non-letters from the message:
- # Use a regular expression to remove non-self.LETTERS from the message:
+ message = self.NONLETTERS_PATTERN.sub('', message.upper())
- message = self.NONself.LETTERS_PATTERN.sub('', message.upper())
+
-
# Compile a list of seqLen-letter sequences found in the message:
seqSpacings = {} # Keys are sequences, values are lists of int spacings.
for seqLen in range(3, 6):
for seqStart in range(len(message) - seqLen):
# Determine what the sequence is, and store it in seq:
seq = message[seqStart:seqStart + seqLen]
+
-
# Look for this sequence in the rest of the message:
for i in range(seqStart + seqLen, len(message) - seqLen):
if message[i:i + seqLen] == seq:
# Found a repeated sequence.
if seq not in seqSpacings:
seqSpacings[seq] = [] # Initialize a blank list.
+
-
# Append the spacing distance between the repeated
# sequence and the original sequence:
seqSpacings[seq].append(i - seqStart)
return seqSpacings
===========changed ref 3===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.primeNum
+
+
===========changed ref 4===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.detectEnglish
+
+
===========changed ref 5===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.cryptomath
+
+
===========changed ref 6===========
+ # module: app.Decryptor.basicEncryption.freqAnalysis
+
+
===========changed ref 7===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.rabinMiller
+
+
===========changed ref 8===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.freqAnalysis
+
+
===========changed ref 9===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+ # Exceptions
+ class PyperclipException(RuntimeError):
+ pass
+
===========changed ref 10===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.addNumbers
+ def addNumbers(a, b):
+ return a + b
+
===========changed ref 11===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.viginere
+ class Viginere:
+
+
+ def getItemAtIndexOne(self, items):
+ return items[1]
+
===========changed ref 12===========
+ # module: app.Decryptor.basicEncryption.freqAnalysis
+
+
+ def getItemAtIndexZero(items):
+ return items[0]
+
===========changed ref 13===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.freqAnalysis
+
+
+ def getItemAtIndexZero(items):
+ return items[0]
+
===========changed ref 14===========
# module: app.mathsHelper
class mathsHelper:
+
+
+ def getItemAtIndexZero(self, items):
+ return items[0]
+
===========changed ref 15===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.passingReference
+ def eggs(someParameter):
+ someParameter.append('Hello')
+
===========changed ref 16===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.affineHacker
+
+ SILENT_MODE = False
+
===========changed ref 17===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.simpleSubDictionaryHacker
+
+ SILENT_MODE = False
+
===========changed ref 18===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.detectEnglish
+
+ ENGLISH_WORDS = loadDictionary()
+
===========changed ref 19===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+
+ # Windows-related clipboard functions:
+ class CheckedCall(object):
+
+ def __setattr__(self, key, value):
+ setattr(self.f, key, value)
+
===========changed ref 20===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereCipher
+
+
+ def decryptMessage(key, message):
+ return translateMessage(key, message, 'decrypt')
+
===========changed ref 21===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereCipher
+
+
+ def encryptMessage(key, message):
+ return translateMessage(key, message, 'encrypt')
+
===========changed ref 22===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.viginere
+ class Viginere:
+ def decryptMessage(self, key, message):
+ return self.translateMessage(key, message, 'decrypt')
+
===========changed ref 23===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.simpleSubDictionaryHacker
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 24===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.transpositionHacker
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 25===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereDictionaryHacker
+
+ if __name__ == '__main__':
+ main()
+
===========changed ref 26===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+
+ # Windows-related clipboard functions:
+ class CheckedCall(object):
+ def __init__(self, f):
+ super(CheckedCall, self).__setattr__("f", f)
+ |
app.Decryptor.basicEncryption.viginere/Viginere.getMostCommonFactors | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <2>:<add>
<del>
<12>:<add>
<del>
<17>:<add> # Exclude factors larger than MAX_KEY_LENGTH:
<del> # Exclude factors larger than self.MAX_KEY_LENGTH:
<22>:<add>
<del>
<24>:<add> factorsByCount.sort(key=self.getItemAtIndexOne, reverse=True)
<del> factorsByCount.sort(key=getItemAtIndexOne, reverse=True)
<25>:<add>
<del>
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getMostCommonFactors(self, seqFactors):
<0> # First, get a count of how many times a factor occurs in seqFactors:
<1> factorCounts = {} # Key is a factor, value is how often it occurs.
<2>
<3> # seqFactors keys are sequences, values are lists of factors of the
<4> # spacings. seqFactors has a value like: {'GFD': [2, 3, 4, 6, 9, 12,
<5> # 18, 23, 36, 46, 69, 92, 138, 207], 'ALW': [2, 3, 4, 6, ...], ...}
<6> for seq in seqFactors:
<7> factorList = seqFactors[seq]
<8> for factor in factorList:
<9> if factor not in factorCounts:
<10> factorCounts[factor] = 0
<11> factorCounts[factor] += 1
<12>
<13> # Second, put the factor and its count into a tuple, and make a list
<14> # of these tuples so we can sort them:
<15> factorsByCount = []
<16> for factor in factorCounts:
<17> # Exclude factors larger than self.MAX_KEY_LENGTH:
<18> if factor <= self.MAX_KEY_LENGTH:
<19> # factorsByCount is a list of tuples: (factor, factorCount)
<20> # factorsByCount has a value like: [(3, 497), (2, 487), ...]
<21> factorsByCount.append( (factor, factorCounts[factor]) )
<22>
<23> # Sort the list by the factor count:
<24> factorsByCount.sort(key=getItemAtIndexOne, reverse=True)
<25>
<26> return factorsByCount
<27>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
+ result = self.hackVigenere(text)
- result = hackVigenere(text)
- print(result)
if result['IsPlaintext?']:
return result
else:
+ return result
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
+ self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ self.SILENT_MODE = True # If set to True, program doesn't print anything.
+ self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
+ self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
+
self.lc = lc
- self.MAX_KEY_LENGTH = 16
- self.self.NONself.LETTERS_PATTERN = re.compile('[^A-Z]')
- self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- self.analysis = ""
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getUsefulFactors(self, num):
- # Will not attempt keys longer than this.
# Returns a list of useful factors of num. By "useful" we mean factors
+ # less than MAX_KEY_LENGTH + 1 and not 1. For example,
- # less than self.MAX_KEY_LENGTH + 1 and not 1. For example,
# getUsefulFactors(144) returns [2, 3, 4, 6, 8, 9, 12, 16]
+
-
if num < 2:
return [] # Numbers less than 2 have no useful factors.
+
-
factors = [] # The list of factors found.
+
-
# When finding factors, you only need to check the integers up to
+ # MAX_KEY_LENGTH.
- # self.MAX_KEY_LENGTH.
for i in range(2, self.MAX_KEY_LENGTH + 1): # Don't test 1: it's not useful.
if num % i == 0:
factors.append(i)
otherFactor = int(num / i)
if otherFactor < self.MAX_KEY_LENGTH + 1 and otherFactor != 1:
factors.append(otherFactor)
return list(set(factors)) # Remove duplicate factors.
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
def findRepeatSequencesSpacings(self, message):
-
# Goes through the message and finds any 3 to 5 letter sequences
# that are repeated. Returns a dict with the keys of the sequence and
+ # values of a list of spacings (num of letters between the repeats).
- # values of a list of spacings (num of self.LETTERS between the repeats).
+
-
+ # Use a regular expression to remove non-letters from the message:
- # Use a regular expression to remove non-self.LETTERS from the message:
+ message = self.NONLETTERS_PATTERN.sub('', message.upper())
- message = self.NONself.LETTERS_PATTERN.sub('', message.upper())
+
-
# Compile a list of seqLen-letter sequences found in the message:
seqSpacings = {} # Keys are sequences, values are lists of int spacings.
for seqLen in range(3, 6):
for seqStart in range(len(message) - seqLen):
# Determine what the sequence is, and store it in seq:
seq = message[seqStart:seqStart + seqLen]
+
-
# Look for this sequence in the rest of the message:
for i in range(seqStart + seqLen, len(message) - seqLen):
if message[i:i + seqLen] == seq:
# Found a repeated sequence.
if seq not in seqSpacings:
seqSpacings[seq] = [] # Initialize a blank list.
+
-
# Append the spacing distance between the repeated
# sequence and the original sequence:
seqSpacings[seq].append(i - seqStart)
return seqSpacings
===========changed ref 4===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.primeNum
+
+
===========changed ref 5===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.detectEnglish
+
+
===========changed ref 6===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.cryptomath
+
+
===========changed ref 7===========
+ # module: app.Decryptor.basicEncryption.freqAnalysis
+
+
===========changed ref 8===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.rabinMiller
+
+
===========changed ref 9===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.freqAnalysis
+
+
===========changed ref 10===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+ # Exceptions
+ class PyperclipException(RuntimeError):
+ pass
+
===========changed ref 11===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.addNumbers
+ def addNumbers(a, b):
+ return a + b
+
===========changed ref 12===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.viginere
+ class Viginere:
+
+
+ def getItemAtIndexOne(self, items):
+ return items[1]
+
===========changed ref 13===========
+ # module: app.Decryptor.basicEncryption.freqAnalysis
+
+
+ def getItemAtIndexZero(items):
+ return items[0]
+
===========changed ref 14===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.freqAnalysis
+
+
+ def getItemAtIndexZero(items):
+ return items[0]
+
===========changed ref 15===========
# module: app.mathsHelper
class mathsHelper:
+
+
+ def getItemAtIndexZero(self, items):
+ return items[0]
+
===========changed ref 16===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.passingReference
+ def eggs(someParameter):
+ someParameter.append('Hello')
+
===========changed ref 17===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.affineHacker
+
+ SILENT_MODE = False
+
===========changed ref 18===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.simpleSubDictionaryHacker
+
+ SILENT_MODE = False
+
===========changed ref 19===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.detectEnglish
+
+ ENGLISH_WORDS = loadDictionary()
+
===========changed ref 20===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+
+ # Windows-related clipboard functions:
+ class CheckedCall(object):
+
+ def __setattr__(self, key, value):
+ setattr(self.f, key, value)
+
===========changed ref 21===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.vigenereCipher
+
+
+ def decryptMessage(key, message):
+ return translateMessage(key, message, 'decrypt')
+ |
app.Decryptor.basicEncryption.viginere/Viginere.kasiskiExamination | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <0>:<add> # Find out the sequences of 3 to 5 letters that occur multiple times
<del> # Find out the sequences of 3 to 5 self.LETTERS that occur multiple times
<4>:<add>
<del>
<11>:<add>
<del>
<14>:<add>
<del>
<21>:<add>
<del>
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def kasiskiExamination(self, ciphertext):
<0> # Find out the sequences of 3 to 5 self.LETTERS that occur multiple times
<1> # in the ciphertext. repeatedSeqSpacings has a value like:
<2> # {'EXG': [192], 'NAF': [339, 972, 633], ... }
<3> repeatedSeqSpacings = self.findRepeatSequencesSpacings(ciphertext)
<4>
<5> # (See getMostCommonFactors() for a description of seqFactors.)
<6> seqFactors = {}
<7> for seq in repeatedSeqSpacings:
<8> seqFactors[seq] = []
<9> for spacing in repeatedSeqSpacings[seq]:
<10> seqFactors[seq].extend(self.getUsefulFactors(spacing))
<11>
<12> # (See getMostCommonFactors() for a description of factorsByCount.)
<13> factorsByCount = self.getMostCommonFactors(seqFactors)
<14>
<15> # Now we extract the factor counts from factorsByCount and
<16> # put them in allLikelyKeyLengths so that they are easier to
<17> # use later:
<18> allLikelyKeyLengths = []
<19> for twoIntTuple in factorsByCount:
<20> allLikelyKeyLengths.append(twoIntTuple[0])
<21>
<22> return allLikelyKeyLengths
<23>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.viginere.Viginere
getItemAtIndexOne(self, items)
getItemAtIndexOne(items)
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
+ result = self.hackVigenere(text)
- result = hackVigenere(text)
- print(result)
if result['IsPlaintext?']:
return result
else:
+ return result
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
+ self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ self.SILENT_MODE = True # If set to True, program doesn't print anything.
+ self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
+ self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
+
self.lc = lc
- self.MAX_KEY_LENGTH = 16
- self.self.NONself.LETTERS_PATTERN = re.compile('[^A-Z]')
- self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- self.analysis = ""
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getUsefulFactors(self, num):
- # Will not attempt keys longer than this.
# Returns a list of useful factors of num. By "useful" we mean factors
+ # less than MAX_KEY_LENGTH + 1 and not 1. For example,
- # less than self.MAX_KEY_LENGTH + 1 and not 1. For example,
# getUsefulFactors(144) returns [2, 3, 4, 6, 8, 9, 12, 16]
+
-
if num < 2:
return [] # Numbers less than 2 have no useful factors.
+
-
factors = [] # The list of factors found.
+
-
# When finding factors, you only need to check the integers up to
+ # MAX_KEY_LENGTH.
- # self.MAX_KEY_LENGTH.
for i in range(2, self.MAX_KEY_LENGTH + 1): # Don't test 1: it's not useful.
if num % i == 0:
factors.append(i)
otherFactor = int(num / i)
if otherFactor < self.MAX_KEY_LENGTH + 1 and otherFactor != 1:
factors.append(otherFactor)
return list(set(factors)) # Remove duplicate factors.
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getMostCommonFactors(self, seqFactors):
# First, get a count of how many times a factor occurs in seqFactors:
factorCounts = {} # Key is a factor, value is how often it occurs.
+
-
# seqFactors keys are sequences, values are lists of factors of the
# spacings. seqFactors has a value like: {'GFD': [2, 3, 4, 6, 9, 12,
# 18, 23, 36, 46, 69, 92, 138, 207], 'ALW': [2, 3, 4, 6, ...], ...}
for seq in seqFactors:
factorList = seqFactors[seq]
for factor in factorList:
if factor not in factorCounts:
factorCounts[factor] = 0
factorCounts[factor] += 1
+
-
# Second, put the factor and its count into a tuple, and make a list
# of these tuples so we can sort them:
factorsByCount = []
for factor in factorCounts:
+ # Exclude factors larger than MAX_KEY_LENGTH:
- # Exclude factors larger than self.MAX_KEY_LENGTH:
if factor <= self.MAX_KEY_LENGTH:
# factorsByCount is a list of tuples: (factor, factorCount)
# factorsByCount has a value like: [(3, 497), (2, 487), ...]
factorsByCount.append( (factor, factorCounts[factor]) )
+
-
# Sort the list by the factor count:
+ factorsByCount.sort(key=self.getItemAtIndexOne, reverse=True)
- factorsByCount.sort(key=getItemAtIndexOne, reverse=True)
+
-
return factorsByCount
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
def findRepeatSequencesSpacings(self, message):
-
# Goes through the message and finds any 3 to 5 letter sequences
# that are repeated. Returns a dict with the keys of the sequence and
+ # values of a list of spacings (num of letters between the repeats).
- # values of a list of spacings (num of self.LETTERS between the repeats).
+
-
+ # Use a regular expression to remove non-letters from the message:
- # Use a regular expression to remove non-self.LETTERS from the message:
+ message = self.NONLETTERS_PATTERN.sub('', message.upper())
- message = self.NONself.LETTERS_PATTERN.sub('', message.upper())
+
-
# Compile a list of seqLen-letter sequences found in the message:
seqSpacings = {} # Keys are sequences, values are lists of int spacings.
for seqLen in range(3, 6):
for seqStart in range(len(message) - seqLen):
# Determine what the sequence is, and store it in seq:
seq = message[seqStart:seqStart + seqLen]
+
-
# Look for this sequence in the rest of the message:
for i in range(seqStart + seqLen, len(message) - seqLen):
if message[i:i + seqLen] == seq:
# Found a repeated sequence.
if seq not in seqSpacings:
seqSpacings[seq] = [] # Initialize a blank list.
+
-
# Append the spacing distance between the repeated
# sequence and the original sequence:
seqSpacings[seq].append(i - seqStart)
return seqSpacings
===========changed ref 5===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.primeNum
+
+
===========changed ref 6===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.detectEnglish
+
+
===========changed ref 7===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.cryptomath
+
+
===========changed ref 8===========
+ # module: app.Decryptor.basicEncryption.freqAnalysis
+
+
===========changed ref 9===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.rabinMiller
+
+
===========changed ref 10===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.freqAnalysis
+
+
===========changed ref 11===========
+ # module: app.Decryptor.basicEncryption.CrackingCodesFiles.pyperclip
+
+
+
+ # Exceptions
+ class PyperclipException(RuntimeError):
+ pass
+ |
app.Decryptor.basicEncryption.viginere/Viginere.getNthSubkeysLetters | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <0>:<add> # Returns every nth letter for each keyLength set of letters in text.
<del> # Returns every nth letter for each keyLength set of self.LETTERS in text.
<1>:<add> # E.g. getNthSubkeysLetters(1, 3, 'ABCABCABC') returns 'AAA'
<del> # E.g. getNthSubkeysself.LETTERS(1, 3, 'ABCABCABC') returns 'AAA'
<2>:<add> # getNthSubkeysLetters(2, 3, 'ABCABCABC') returns 'BBB'
<del> # getNthSubkeysself.LETTERS(2, 3, 'ABCABCABC') returns 'BBB'
<3>:<add> # getNthSubkeysLetters(3, 3, 'ABCABCABC') returns 'CCC'
<del> # getNthSubkeysself.LETTERS(3, 3, 'ABCABCABC') returns 'CCC'
<4>:<add> # getNthSubkeysLetters(1, 5, 'ABCDEFGHI') returns 'AF'
<del> # getNthSubkeysself.LETTERS(1, 5, 'ABCDEFGHI') returns 'AF'
<5>:<add>
<del>
<6>:<add> # Use a regular expression to remove non-letters from the message:
<del> # Use a regular expression to remove non-self.LETTERS from the message:
<7>:<add> message = self.NONLETTERS_PATTERN.sub('', message)
<del> message = self.NONself.LETTERS_PATTERN.sub('', message)
<8>:<add>
<del>
<10>:<add> letters = []
<del> self.LETTERS = []
<12>:<add> letters.append(message[i])
<del> self.LETTERS.append(message[i])
<14>:<add> return ''.join(letters)
<del> return ''.join(self.LETTERS)
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getNthSubkeysLetters(self, nth, keyLength, message):
<0> # Returns every nth letter for each keyLength set of self.LETTERS in text.
<1> # E.g. getNthSubkeysself.LETTERS(1, 3, 'ABCABCABC') returns 'AAA'
<2> # getNthSubkeysself.LETTERS(2, 3, 'ABCABCABC') returns 'BBB'
<3> # getNthSubkeysself.LETTERS(3, 3, 'ABCABCABC') returns 'CCC'
<4> # getNthSubkeysself.LETTERS(1, 5, 'ABCDEFGHI') returns 'AF'
<5>
<6> # Use a regular expression to remove non-self.LETTERS from the message:
<7> message = self.NONself.LETTERS_PATTERN.sub('', message)
<8>
<9> i = nth - 1
<10> self.LETTERS = []
<11> while i < len(message):
<12> self.LETTERS.append(message[i])
<13> i += keyLength
<14> return ''.join(self.LETTERS)
<15>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.viginere.Viginere
findRepeatSequencesSpacings(self, message)
findRepeatSequencesSpacings(message)
getUsefulFactors(self, num)
getUsefulFactors(num)
getMostCommonFactors(self, seqFactors)
getMostCommonFactors(seqFactors)
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getUsefulFactors(self, num):
- # Will not attempt keys longer than this.
# Returns a list of useful factors of num. By "useful" we mean factors
+ # less than MAX_KEY_LENGTH + 1 and not 1. For example,
- # less than self.MAX_KEY_LENGTH + 1 and not 1. For example,
# getUsefulFactors(144) returns [2, 3, 4, 6, 8, 9, 12, 16]
+
-
if num < 2:
return [] # Numbers less than 2 have no useful factors.
+
-
factors = [] # The list of factors found.
+
-
# When finding factors, you only need to check the integers up to
+ # MAX_KEY_LENGTH.
- # self.MAX_KEY_LENGTH.
for i in range(2, self.MAX_KEY_LENGTH + 1): # Don't test 1: it's not useful.
if num % i == 0:
factors.append(i)
otherFactor = int(num / i)
if otherFactor < self.MAX_KEY_LENGTH + 1 and otherFactor != 1:
factors.append(otherFactor)
return list(set(factors)) # Remove duplicate factors.
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getMostCommonFactors(self, seqFactors):
# First, get a count of how many times a factor occurs in seqFactors:
factorCounts = {} # Key is a factor, value is how often it occurs.
+
-
# seqFactors keys are sequences, values are lists of factors of the
# spacings. seqFactors has a value like: {'GFD': [2, 3, 4, 6, 9, 12,
# 18, 23, 36, 46, 69, 92, 138, 207], 'ALW': [2, 3, 4, 6, ...], ...}
for seq in seqFactors:
factorList = seqFactors[seq]
for factor in factorList:
if factor not in factorCounts:
factorCounts[factor] = 0
factorCounts[factor] += 1
+
-
# Second, put the factor and its count into a tuple, and make a list
# of these tuples so we can sort them:
factorsByCount = []
for factor in factorCounts:
+ # Exclude factors larger than MAX_KEY_LENGTH:
- # Exclude factors larger than self.MAX_KEY_LENGTH:
if factor <= self.MAX_KEY_LENGTH:
# factorsByCount is a list of tuples: (factor, factorCount)
# factorsByCount has a value like: [(3, 497), (2, 487), ...]
factorsByCount.append( (factor, factorCounts[factor]) )
+
-
# Sort the list by the factor count:
+ factorsByCount.sort(key=self.getItemAtIndexOne, reverse=True)
- factorsByCount.sort(key=getItemAtIndexOne, reverse=True)
+
-
return factorsByCount
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
def findRepeatSequencesSpacings(self, message):
-
# Goes through the message and finds any 3 to 5 letter sequences
# that are repeated. Returns a dict with the keys of the sequence and
+ # values of a list of spacings (num of letters between the repeats).
- # values of a list of spacings (num of self.LETTERS between the repeats).
+
-
+ # Use a regular expression to remove non-letters from the message:
- # Use a regular expression to remove non-self.LETTERS from the message:
+ message = self.NONLETTERS_PATTERN.sub('', message.upper())
- message = self.NONself.LETTERS_PATTERN.sub('', message.upper())
+
-
# Compile a list of seqLen-letter sequences found in the message:
seqSpacings = {} # Keys are sequences, values are lists of int spacings.
for seqLen in range(3, 6):
for seqStart in range(len(message) - seqLen):
# Determine what the sequence is, and store it in seq:
seq = message[seqStart:seqStart + seqLen]
+
-
# Look for this sequence in the rest of the message:
for i in range(seqStart + seqLen, len(message) - seqLen):
if message[i:i + seqLen] == seq:
# Found a repeated sequence.
if seq not in seqSpacings:
seqSpacings[seq] = [] # Initialize a blank list.
+
-
# Append the spacing distance between the repeated
# sequence and the original sequence:
seqSpacings[seq].append(i - seqStart)
return seqSpacings
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
+ result = self.hackVigenere(text)
- result = hackVigenere(text)
- print(result)
if result['IsPlaintext?']:
return result
else:
+ return result
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
+ self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ self.SILENT_MODE = True # If set to True, program doesn't print anything.
+ self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
+ self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
+
self.lc = lc
- self.MAX_KEY_LENGTH = 16
- self.self.NONself.LETTERS_PATTERN = re.compile('[^A-Z]')
- self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- self.analysis = ""
|
app.Decryptor.basicEncryption.viginere/Viginere.attemptHackWithKeyLength | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <0>:<add> # Determine the most likely letters for each letter in the key:
<del> # Determine the most likely self.LETTERS for each letter in the key:
<6>:<add> nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
<del> nthself.LETTERS = self.getNthSubkeysself.LETTERS(nth, mostLikelyKeyLength, ciphertextUp)
<7>:<add>
<del>
<14>:<add> decryptedText = self.decryptMessage(possibleKey, nthLetters)
<del> decryptedText = vigenereCipher.decryptMessage(possibleKey, nthself.LETTERS)
<18>:<add> freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
<del> freqScores.sort(key=getItemAtIndexOne, reverse=True)
<19>:<del>
<20>:<del> allFreqScores.append(freqScores[:NUM_MOST_FREQ_LETTERS])
<22>:<add> allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
<add>
<add> if not self.SILENT_MODE:
<add> for i in range(len(allFreqScores)):
<add> # Use i + 1 so the first letter is not called the "0th" letter:
<add> print('Possible letters for letter %s of the key: ' % (i + 1), end='')
<add> for freqScore in allFreqScores[i]:
<add> print('%s ' % freqScore[0], | # module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
<0> # Determine the most likely self.LETTERS for each letter in the key:
<1> ciphertextUp = ciphertext.upper()
<2> # allFreqScores is a list of mostLikelyKeyLength number of lists.
<3> # These inner lists are the freqScores lists.
<4> allFreqScores = []
<5> for nth in range(1, mostLikelyKeyLength + 1):
<6> nthself.LETTERS = self.getNthSubkeysself.LETTERS(nth, mostLikelyKeyLength, ciphertextUp)
<7>
<8> # freqScores is a list of tuples like:
<9> # [(<letter>, <Eng. Freq. match score>), ... ]
<10> # List is sorted by match score. Higher score means better match.
<11> # See the englishFreqMatchScore() comments in freqAnalysis.py.
<12> freqScores = []
<13> for possibleKey in self.LETTERS:
<14> decryptedText = vigenereCipher.decryptMessage(possibleKey, nthself.LETTERS)
<15> keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
<16> freqScores.append(keyAndFreqMatchTuple)
<17> # Sort by match score:
<18> freqScores.sort(key=getItemAtIndexOne, reverse=True)
<19>
<20> allFreqScores.append(freqScores[:NUM_MOST_FREQ_LETTERS])
<21>
<22> # Try every combination of the most likely self.LETTERS for each position
<23> # in the key:
<24> for indexes in itertools.product(range(NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
<25> # Create a possible key from the self.LETTERS in allFreqScores:
<26> possibleKey = ''
<27> for i in range(mostLik</s> | ===========below chunk 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 1
possibleKey += allFreqScores[i][indexes[i]][0]
decryptedText = vigenereCipher.decryptMessage(possibleKey, ciphertextUp)
if self.lc.checkLanguage(translated):
# Set the hacked ciphertext to the original casing:
origCase = []
for i in range(len(ciphertext)):
if ciphertext[i].isupper():
origCase.append(decryptedText[i].upper())
else:
origCase.append(decryptedText[i].lower())
decryptedText = ''.join(origCase)
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}. The key used is {possibleKey}"}
# No English-looking decryption found, so return None:
return None
===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.viginere.Viginere
getItemAtIndexOne(self, items)
getItemAtIndexOne(items)
decryptMessage(self, key, message)
decryptMessage(key, message)
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
at: app.Decryptor.basicEncryption.viginere.Viginere.kasiskiExamination
factorsByCount = self.getMostCommonFactors(seqFactors)
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
+ result = self.hackVigenere(text)
- result = hackVigenere(text)
- print(result)
if result['IsPlaintext?']:
return result
else:
+ return result
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
+ self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ self.SILENT_MODE = True # If set to True, program doesn't print anything.
+ self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
+ self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
+
self.lc = lc
- self.MAX_KEY_LENGTH = 16
- self.self.NONself.LETTERS_PATTERN = re.compile('[^A-Z]')
- self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- self.analysis = ""
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def kasiskiExamination(self, ciphertext):
+ # Find out the sequences of 3 to 5 letters that occur multiple times
- # Find out the sequences of 3 to 5 self.LETTERS that occur multiple times
# in the ciphertext. repeatedSeqSpacings has a value like:
# {'EXG': [192], 'NAF': [339, 972, 633], ... }
repeatedSeqSpacings = self.findRepeatSequencesSpacings(ciphertext)
+
-
# (See getMostCommonFactors() for a description of seqFactors.)
seqFactors = {}
for seq in repeatedSeqSpacings:
seqFactors[seq] = []
for spacing in repeatedSeqSpacings[seq]:
seqFactors[seq].extend(self.getUsefulFactors(spacing))
+
-
# (See getMostCommonFactors() for a description of factorsByCount.)
factorsByCount = self.getMostCommonFactors(seqFactors)
+
-
# Now we extract the factor counts from factorsByCount and
# put them in allLikelyKeyLengths so that they are easier to
# use later:
allLikelyKeyLengths = []
for twoIntTuple in factorsByCount:
allLikelyKeyLengths.append(twoIntTuple[0])
+
-
return allLikelyKeyLengths
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getUsefulFactors(self, num):
- # Will not attempt keys longer than this.
# Returns a list of useful factors of num. By "useful" we mean factors
+ # less than MAX_KEY_LENGTH + 1 and not 1. For example,
- # less than self.MAX_KEY_LENGTH + 1 and not 1. For example,
# getUsefulFactors(144) returns [2, 3, 4, 6, 8, 9, 12, 16]
+
-
if num < 2:
return [] # Numbers less than 2 have no useful factors.
+
-
factors = [] # The list of factors found.
+
-
# When finding factors, you only need to check the integers up to
+ # MAX_KEY_LENGTH.
- # self.MAX_KEY_LENGTH.
for i in range(2, self.MAX_KEY_LENGTH + 1): # Don't test 1: it's not useful.
if num % i == 0:
factors.append(i)
otherFactor = int(num / i)
if otherFactor < self.MAX_KEY_LENGTH + 1 and otherFactor != 1:
factors.append(otherFactor)
return list(set(factors)) # Remove duplicate factors.
|
app.Decryptor.basicEncryption.viginere/Viginere.hackVigenere | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <2>:<add> allLikelyKeyLengths = self.kasiskiExamination(ciphertext)
<del> allLikelyKeyLengths = kasiskiExamination(ciphertext)
<3>:<add> if not self.SILENT_MODE:
<del> if not SILENT_MODE:
<7>:<add> print('Kasiski Examination results say the most likely key lengths are: ' + keyLengthStr + '\n')
<del> self.analysis = f'Kasiski Examination results say the most likely key lengths are {keyLengthStr}'
<10>:<add> if not self.SILENT_MODE:
<add> print('Attempting hack with key length %s (%s possible keys)...' % (keyLength, self.NUM_MOST_FREQ_LETTERS ** keyLength))
<add> hackedMessage = self.attemptHackWithKeyLength(ciphertext, keyLength)
<del> hackedMessage = attemptHackWithKeyLength(ciphertext, keyLength)
<13>:<add>
<del>
<17>:<add> if not self.SILENT_MODE:
<add> print('Unable to hack message with likely key length(s). Brute forcing key length...')
<add> for keyLength in range(1, self.MAX_KEY_LENGTH + 1):
<del> for keyLength in range(1, MAX_KEY_LENGTH + 1):
<20>:<del> # First, we need to do Kasiski Examination to figure out what the
<21>:<del> # length of the ciphertext's encryption key is:
<22>:<del> allLikelyKeyLengths = kasiskiExamination(ciphertext)
<23>:<add> if not self.SILENT_MODE:
<del> if not SILENT_MODE:
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def hackVigenere(self, ciphertext):
<0> # First, we need to do Kasiski Examination to figure out what the
<1> # length of the ciphertext's encryption key is:
<2> allLikelyKeyLengths = kasiskiExamination(ciphertext)
<3> if not SILENT_MODE:
<4> keyLengthStr = ''
<5> for keyLength in allLikelyKeyLengths:
<6> keyLengthStr += '%s ' % (keyLength)
<7> self.analysis = f'Kasiski Examination results say the most likely key lengths are {keyLengthStr}'
<8> hackedMessage = None
<9> for keyLength in allLikelyKeyLengths:
<10> hackedMessage = attemptHackWithKeyLength(ciphertext, keyLength)
<11> if hackedMessage != None:
<12> break
<13>
<14> # If none of the key lengths we found using Kasiski Examination
<15> # worked, start brute-forcing through key lengths:
<16> if hackedMessage == None:
<17> for keyLength in range(1, MAX_KEY_LENGTH + 1):
<18> # Don't re-check key lengths already tried from Kasiski:
<19> if keyLength not in allLikelyKeyLengths:
<20> # First, we need to do Kasiski Examination to figure out what the
<21> # length of the ciphertext's encryption key is:
<22> allLikelyKeyLengths = kasiskiExamination(ciphertext)
<23> if not SILENT_MODE:
<24> keyLengthStr = ''
<25> for keyLength in allLikelyKeyLengths:
<26> keyLengthStr += '%s ' % (keyLength)
<27> hackedMessage = None
<28> for keyLength in allLikelyKeyLengths:
<29> hackedMessage = attemptHackWithKeyLength(ciphertext, keyLength)
<30> if hackedMessage != None:
<31> break
<32>
<33> </s> | ===========below chunk 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def hackVigenere(self, ciphertext):
# offset: 1
# worked, start brute-forcing through key lengths:
if hackedMessage == None:
for keyLength in range(1, MAX_KEY_LENGTH + 1):
# Don't re-check key lengths already tried from Kasiski:
if keyLength not in allLikelyKeyLengths:
hackedMessage = attemptHackWithKeyLength(ciphertext, keyLength)
if hackedMessage != None:
break
return hackedMessage
hackedMessage = attemptHackWithKeyLength(ciphertext, keyLength)
if hackedMessage != None:
break
return hackedMessage
===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.viginere.Viginere
kasiskiExamination(ciphertext)
kasiskiExamination(self, ciphertext)
decryptMessage(self, key, message)
decryptMessage(key, message)
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
self.lc = lc
at: app.Decryptor.basicEncryption.viginere.Viginere.attemptHackWithKeyLength
ciphertextUp = ciphertext.upper()
allFreqScores = []
freqScores = []
===========unchanged ref 1===========
at: itertools
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]
product(*iterables: Iterable[_T1], repeat: int) -> Iterator[Tuple[_T1, ...]]
product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]
product(*iterables: Iterable[Any], repeat: int=...) -> Iterator[Tuple[Any, ...]]
product(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any], iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any], iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def kasiskiExamination(self, ciphertext):
+ # Find out the sequences of 3 to 5 letters that occur multiple times
- # Find out the sequences of 3 to 5 self.LETTERS that occur multiple times
# in the ciphertext. repeatedSeqSpacings has a value like:
# {'EXG': [192], 'NAF': [339, 972, 633], ... }
repeatedSeqSpacings = self.findRepeatSequencesSpacings(ciphertext)
+
-
# (See getMostCommonFactors() for a description of seqFactors.)
seqFactors = {}
for seq in repeatedSeqSpacings:
seqFactors[seq] = []
for spacing in repeatedSeqSpacings[seq]:
seqFactors[seq].extend(self.getUsefulFactors(spacing))
+
-
# (See getMostCommonFactors() for a description of factorsByCount.)
factorsByCount = self.getMostCommonFactors(seqFactors)
+
-
# Now we extract the factor counts from factorsByCount and
# put them in allLikelyKeyLengths so that they are easier to
# use later:
allLikelyKeyLengths = []
for twoIntTuple in factorsByCount:
allLikelyKeyLengths.append(twoIntTuple[0])
+
-
return allLikelyKeyLengths
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
+ result = self.hackVigenere(text)
- result = hackVigenere(text)
- print(result)
if result['IsPlaintext?']:
return result
else:
+ return result
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
+ self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ self.SILENT_MODE = True # If set to True, program doesn't print anything.
+ self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
+ self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
+
self.lc = lc
- self.MAX_KEY_LENGTH = 16
- self.self.NONself.LETTERS_PATTERN = re.compile('[^A-Z]')
- self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- self.analysis = ""
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getUsefulFactors(self, num):
- # Will not attempt keys longer than this.
# Returns a list of useful factors of num. By "useful" we mean factors
+ # less than MAX_KEY_LENGTH + 1 and not 1. For example,
- # less than self.MAX_KEY_LENGTH + 1 and not 1. For example,
# getUsefulFactors(144) returns [2, 3, 4, 6, 8, 9, 12, 16]
+
-
if num < 2:
return [] # Numbers less than 2 have no useful factors.
+
-
factors = [] # The list of factors found.
+
-
# When finding factors, you only need to check the integers up to
+ # MAX_KEY_LENGTH.
- # self.MAX_KEY_LENGTH.
for i in range(2, self.MAX_KEY_LENGTH + 1): # Don't test 1: it's not useful.
if num % i == 0:
factors.append(i)
otherFactor = int(num / i)
if otherFactor < self.MAX_KEY_LENGTH + 1 and otherFactor != 1:
factors.append(otherFactor)
return list(set(factors)) # Remove duplicate factors.
|
app.Decryptor.basicEncryption.viginere/Viginere.decryptMessage | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <0>:<add> return self.translateMessage(key, message, 'decrypt')
<del> return translateMessage(key, message, 'decrypt')
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
-
-
def decryptMessage(self, key, message):
<0> return translateMessage(key, message, 'decrypt')
<1>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
at: app.Decryptor.basicEncryption.viginere.Viginere.hackVigenere
allLikelyKeyLengths = self.kasiskiExamination(ciphertext)
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
- def encryptMessage(self, key, message):
- return translateMessage(key, message, 'encrypt')
-
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
+ result = self.hackVigenere(text)
- result = hackVigenere(text)
- print(result)
if result['IsPlaintext?']:
return result
else:
+ return result
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
+ self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ self.SILENT_MODE = True # If set to True, program doesn't print anything.
+ self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
+ self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
+
self.lc = lc
- self.MAX_KEY_LENGTH = 16
- self.self.NONself.LETTERS_PATTERN = re.compile('[^A-Z]')
- self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- self.analysis = ""
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def kasiskiExamination(self, ciphertext):
+ # Find out the sequences of 3 to 5 letters that occur multiple times
- # Find out the sequences of 3 to 5 self.LETTERS that occur multiple times
# in the ciphertext. repeatedSeqSpacings has a value like:
# {'EXG': [192], 'NAF': [339, 972, 633], ... }
repeatedSeqSpacings = self.findRepeatSequencesSpacings(ciphertext)
+
-
# (See getMostCommonFactors() for a description of seqFactors.)
seqFactors = {}
for seq in repeatedSeqSpacings:
seqFactors[seq] = []
for spacing in repeatedSeqSpacings[seq]:
seqFactors[seq].extend(self.getUsefulFactors(spacing))
+
-
# (See getMostCommonFactors() for a description of factorsByCount.)
factorsByCount = self.getMostCommonFactors(seqFactors)
+
-
# Now we extract the factor counts from factorsByCount and
# put them in allLikelyKeyLengths so that they are easier to
# use later:
allLikelyKeyLengths = []
for twoIntTuple in factorsByCount:
allLikelyKeyLengths.append(twoIntTuple[0])
+
-
return allLikelyKeyLengths
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getUsefulFactors(self, num):
- # Will not attempt keys longer than this.
# Returns a list of useful factors of num. By "useful" we mean factors
+ # less than MAX_KEY_LENGTH + 1 and not 1. For example,
- # less than self.MAX_KEY_LENGTH + 1 and not 1. For example,
# getUsefulFactors(144) returns [2, 3, 4, 6, 8, 9, 12, 16]
+
-
if num < 2:
return [] # Numbers less than 2 have no useful factors.
+
-
factors = [] # The list of factors found.
+
-
# When finding factors, you only need to check the integers up to
+ # MAX_KEY_LENGTH.
- # self.MAX_KEY_LENGTH.
for i in range(2, self.MAX_KEY_LENGTH + 1): # Don't test 1: it's not useful.
if num % i == 0:
factors.append(i)
otherFactor = int(num / i)
if otherFactor < self.MAX_KEY_LENGTH + 1 and otherFactor != 1:
factors.append(otherFactor)
return list(set(factors)) # Remove duplicate factors.
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getNthSubkeysLetters(self, nth, keyLength, message):
+ # Returns every nth letter for each keyLength set of letters in text.
- # Returns every nth letter for each keyLength set of self.LETTERS in text.
+ # E.g. getNthSubkeysLetters(1, 3, 'ABCABCABC') returns 'AAA'
- # E.g. getNthSubkeysself.LETTERS(1, 3, 'ABCABCABC') returns 'AAA'
+ # getNthSubkeysLetters(2, 3, 'ABCABCABC') returns 'BBB'
- # getNthSubkeysself.LETTERS(2, 3, 'ABCABCABC') returns 'BBB'
+ # getNthSubkeysLetters(3, 3, 'ABCABCABC') returns 'CCC'
- # getNthSubkeysself.LETTERS(3, 3, 'ABCABCABC') returns 'CCC'
+ # getNthSubkeysLetters(1, 5, 'ABCDEFGHI') returns 'AF'
- # getNthSubkeysself.LETTERS(1, 5, 'ABCDEFGHI') returns 'AF'
+
-
+ # Use a regular expression to remove non-letters from the message:
- # Use a regular expression to remove non-self.LETTERS from the message:
+ message = self.NONLETTERS_PATTERN.sub('', message)
- message = self.NONself.LETTERS_PATTERN.sub('', message)
+
-
i = nth - 1
+ letters = []
- self.LETTERS = []
while i < len(message):
+ letters.append(message[i])
- self.LETTERS.append(message[i])
i += keyLength
+ return ''.join(letters)
- return ''.join(self.LETT</s>
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def getNthSubkeysLetters(self, nth, keyLength, message):
# offset: 1
<s>
i += keyLength
+ return ''.join(letters)
- return ''.join(self.LETTERS)
|
app.Decryptor.basicEncryption.viginere/Viginere.translateMessage | Modified | Ciphey~Ciphey | 326e932fa8e472d9a69c8d47a6f9694dcfab6fdd | fixed serious bug with language checker | <7>:<add> if num != -1: # -1 means symbol.upper() was not found in LETTERS.
<del> if num != -1: # -1 means symbol.upper() was not found in self.LETTERS.
<28>:<add> return ''.join(translated)
<del> return ''.join(translated)
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def translateMessage(self, key, message, mode):
<0> translated = [] # Stores the encrypted/decrypted message string.
<1>
<2> keyIndex = 0
<3> key = key.upper()
<4>
<5> for symbol in message: # Loop through each symbol in message.
<6> num = self.LETTERS.find(symbol.upper())
<7> if num != -1: # -1 means symbol.upper() was not found in self.LETTERS.
<8> if mode == 'encrypt':
<9> num += self.LETTERS.find(key[keyIndex]) # Add if encrypting.
<10> elif mode == 'decrypt':
<11> num -= self.LETTERS.find(key[keyIndex]) # Subtract if decrypting.
<12>
<13> num %= len(self.LETTERS) # Handle any wraparound.
<14>
<15> # Add the encrypted/decrypted symbol to the end of translated:
<16> if symbol.isupper():
<17> translated.append(self.LETTERS[num])
<18> elif symbol.islower():
<19> translated.append(self.LETTERS[num].lower())
<20>
<21> keyIndex += 1 # Move to the next letter in the key.
<22> if keyIndex == len(key):
<23> keyIndex = 0
<24> else:
<25> # Append the symbol without encrypting/decrypting.
<26> translated.append(symbol)
<27>
<28> return ''.join(translated)
<29>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.viginere.Viginere
attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength)
attemptHackWithKeyLength(ciphertext, mostLikelyKeyLength)
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
at: app.Decryptor.basicEncryption.viginere.Viginere.hackVigenere
allLikelyKeyLengths = self.kasiskiExamination(ciphertext)
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
+ # Determine the most likely letters for each letter in the key:
- # Determine the most likely self.LETTERS for each letter in the key:
ciphertextUp = ciphertext.upper()
# allFreqScores is a list of mostLikelyKeyLength number of lists.
# These inner lists are the freqScores lists.
allFreqScores = []
for nth in range(1, mostLikelyKeyLength + 1):
+ nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
- nthself.LETTERS = self.getNthSubkeysself.LETTERS(nth, mostLikelyKeyLength, ciphertextUp)
+
-
# freqScores is a list of tuples like:
# [(<letter>, <Eng. Freq. match score>), ... ]
# List is sorted by match score. Higher score means better match.
# See the englishFreqMatchScore() comments in freqAnalysis.py.
freqScores = []
for possibleKey in self.LETTERS:
+ decryptedText = self.decryptMessage(possibleKey, nthLetters)
- decryptedText = vigenereCipher.decryptMessage(possibleKey, nthself.LETTERS)
keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
freqScores.append(keyAndFreqMatchTuple)
# Sort by match score:
+ freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
- freqScores.sort(key=getItemAtIndexOne, reverse=True)
-
- allFreqScores.append(freqScores[:NUM_MOST_FREQ_LETTERS])
+ allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS</s>
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 1
<s>ERS])
+ allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
+
+ if not self.SILENT_MODE:
+ for i in range(len(allFreqScores)):
+ # Use i + 1 so the first letter is not called the "0th" letter:
+ print('Possible letters for letter %s of the key: ' % (i + 1), end='')
+ for freqScore in allFreqScores[i]:
+ print('%s ' % freqScore[0], end='')
+ print() # Print a newline.
+
+ # Try every combination of the most likely letters for each position
- # Try every combination of the most likely self.LETTERS for each position
# in the key:
+ for indexes in itertools.product(range(self.NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
- for indexes in itertools.product(range(NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
+ # Create a possible key from the letters in allFreqScores:
- # Create a possible key from the self.LETTERS in allFreqScores:
possibleKey = ''
for i in range(mostLikelyKeyLength):
possibleKey += allFreqScores[i][indexes[i]][0]
+
+ if not self.SILENT_MODE:
+ print('Attempting with key: %s' % (possibleKey))
+
-
+ decryptedText = self.decryptMessage(possibleKey, ciphertextUp)
- decryptedText = vigenereCipher.decryptMessage(</s>
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
+
+
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 2
<s>, ciphertextUp)
+
-
+ if self.lc.checkLanguage(decryptedText):
- if self.lc.checkLanguage(translated):
# Set the hacked ciphertext to the original casing:
origCase = []
for i in range(len(ciphertext)):
if ciphertext[i].isupper():
origCase.append(decryptedText[i].upper())
else:
origCase.append(decryptedText[i].lower())
decryptedText = ''.join(origCase)
+
+ # Check with user to see if the key has been found:
-
+ return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Viginere", "Extra Information": f"The key used is {possibleKey}"}
- return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}. The key used is {possibleKey}"}
+
-
# No English-looking decryption found, so return None:
return None
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
- def encryptMessage(self, key, message):
- return translateMessage(key, message, 'encrypt')
-
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
-
-
def decryptMessage(self, key, message):
+ return self.translateMessage(key, message, 'decrypt')
- return translateMessage(key, message, 'decrypt')
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def decrypt(self, text):
+ result = self.hackVigenere(text)
- result = hackVigenere(text)
- print(result)
if result['IsPlaintext?']:
return result
else:
+ return result
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Vigenère cipher", "Extra Information": f"{self.analysis}"}
|
app.Decryptor.basicEncryption.viginere/Viginere.__init__ | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <3>:<add> self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
<del> self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
<0> self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
<1> self.SILENT_MODE = True # If set to True, program doesn't print anything.
<2> self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
<3> self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
<4> self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
<5>
<6> self.lc = lc
<7>
| ===========unchanged ref 0===========
at: re
compile(pattern: AnyStr, flags: _FlagsType=...) -> Pattern[AnyStr]
compile(pattern: Pattern[AnyStr], flags: _FlagsType=...) -> Pattern[AnyStr]
|
app.Decryptor.basicEncryption.basic_parent/BasicParent.__init__ | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <4>:<add> self.pig = PigLatin(self.lc)
<5>:<add> self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
<del> self.list_of_objects = [self.caesar, self.reverse, self.viginere]
| # module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
<0> self.lc = lc
<1> self.caesar = Caesar(self.lc)
<2> self.reverse = Reverse(self.lc)
<3> self.viginere = Viginere(self.lc)
<4>
<5> self.list_of_objects = [self.caesar, self.reverse, self.viginere]
<6>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.caesar
Caesar(lc)
at: Decryptor.basicEncryption.pigLatin
PigLatin(lc)
at: Decryptor.basicEncryption.reverse
Reverse(lc)
at: Decryptor.basicEncryption.viginere
Viginere(lc)
at: app.Decryptor.basicEncryption.basic_parent.BasicParent.decrypt
self.lc = self.lc + answer["lc"]
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
|
app.Decryptor.basicEncryption.basic_parent/BasicParent.decrypt | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <13>:<del> print(answer)
| # module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
<0> self.text = text
<1>
<2> from multiprocessing.dummy import Pool as ThreadPool
<3> pool = ThreadPool(4)
<4> answers = pool.map(self.callDecrypt, self.list_of_objects)
<5>
<6> """for item in self.list_of_objects:
<7> result = item.decrypt(text)
<8> answers.append(result)"""
<9> for answer in answers:
<10> # adds the LC objects together
<11> self.lc = self.lc + answer["lc"]
<12> if answer["IsPlaintext?"]:
<13> print(answer)
<14> return answer
<15> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
<16>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.basic_parent.BasicParent
callDecrypt(obj)
at: app.Decryptor.basicEncryption.basic_parent.BasicParent.__init__
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
at: multiprocessing.dummy
Pool(processes: Optional[int]=..., initializer: Optional[Callable[..., Any]]=..., initargs: Iterable[Any]=...) -> Any
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
+ self.pig = PigLatin(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere]
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
|
app.languageCheckerMod.dictionaryChecker/dictionaryChecker.checkDictionary | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | # module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def checkDictionary(self, text, language):
<0> """Compares a word with
<1> The dictionary is sorted and the text is sorted"""
<2> # reads through most common words / passwords
<3> # and calculates how much of that is in language
<4> text = text.lower()
<5> text = self.mh.stripPuncuation(text)
<6> text = text.split(" ")
<7> text = list(set(text)) # removes duplicate words
<8> text.sort()
<9> # can dynamically use languages then
<10> language = str(language) + ".txt"
<11> file = open("languageCheckerMod/English.txt", "r")
<12> f = file.readlines()
<13> file.close()
<14> f = [x.strip().lower() for x in f]
<15> # dictionary is "word\n" so I remove the "\n"
<16>
<17> # so this should loop until it gets to the point in the @staticmethod
<18> # that equals the word :)
<19>
<20> """
<21> for every single word in main dictionary
<22> if that word == text[0] then +1 to counter
<23> then +1 to text[0 + i]
<24> so say the dict is ordered
<25> we just loop through dict
<26> and eventually we'll reach a point where word in dict = word in text
<27> at that point, we move to the next text point
<28> both text and dict are sorted
<29> so we only loop once, we can do this in O(n log n) time
<30> """
<31> counter = 0
<32> counterPercent = 0
<33>
<34> for dictLengthCounter, word in enumerate(f):
<35> # if there is more words counted than there is text
<36> # it is 100%, sometimes it goes over
<37> # so this stops that
<38> if counter >= len(text):
<39> break
<40> # if the dictionary word is contained</s> | ===========below chunk 0===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def checkDictionary(self, text, language):
# offset: 1
# counter + 1
if word in text:
counter = counter + 1
counterPercent = counterPercent + 1
self.languageWordsCounter = counter
self.languagePercentage = self.mh.percentage(float(self.languageWordsCounter), float(len(text)))
return(counter)
===========unchanged ref 0===========
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker.__init__
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
at: io.BufferedRandom
readlines(self, hint: int=..., /) -> List[bytes]
at: io.TextIOWrapper
close(self) -> None
at: mathsHelper.mathsHelper
percentage(part, whole)
stripPuncuation(text)
at: typing.IO
__slots__ = ()
close() -> None
readlines(hint: int=...) -> list[AnyStr]
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
+ self.pig = PigLatin(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere]
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
- print(answer)
return answer
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
|
|
app.Decryptor.Encoding.encodingParent/EncodingParent.__init__ | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <5>:<add> self.morse = MorseCode(self.lc)
| # module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
def __init__(self, lc):
<0> self.lc = lc
<1> self.base64 = Base64(self.lc)
<2> self.binary = Binary(self.lc)
<3> self.hex = Hexadecimal(self.lc)
<4> self.ascii = Ascii(self.lc)
<5>
| ===========unchanged ref 0===========
at: Decryptor.Encoding.base64
Base64(lc)
at: Decryptor.Encoding.binary
Binary(lc)
at: Decryptor.Encoding.hexadecimal
Hexadecimal(lc)
at: app.Decryptor.Encoding.encodingParent.EncodingParent.decrypt
self.lc = self.lc + answer["lc"]
===========changed ref 0===========
+ # module: app.Decryptor.Encoding.morsecode
+
+
===========changed ref 1===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+
+
===========changed ref 2===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+ class PigLatin:
+ def __init__(self, lc):
+ self.lc = lc
+
===========changed ref 3===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def checkIfMorse(self, text):
+ return set(self.ALLOWED).issuperset(text)
+
===========changed ref 4===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+ def unmorse_it(self, text):
+ returnMsg = ""
+ for word in text.split('/'):
+ for char in word.strip().split():
+ # translates every letter
+ returnMsg += self.MORSE_CODE_DICT_INV[char]
+ # after every word add a space
+ returnMsg += " "
+ return returnMsg.strip().capitalize()
+
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
+ self.pig = PigLatin(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere]
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 7===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def decrypt(self, text):
+ if not self.checkIfMorse(text):
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Morse Code", "Extra Information": None}
+ try:
+ result = self.unmorse_it(text)
+ except TypeError as e:
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Morse Code", "Extra Information": None}
+
+
+ return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": result, "Cipher": "Morse Code", "Extra Information": None}
+
===========changed ref 8===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
- print(answer)
return answer
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
===========changed ref 9===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+ def __init__(self, lc):
+ self.lc = lc
+ self.ALLOWED = [".", "-", " ", "/"]
+ self.MORSE_CODE_DICT = {'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': '--..',
+ '?': '..--..', '.': '.-.-.-', ' ': '/',
+ '0': '-----', '1': '.----', '2': '..---',
+ '3': '...--', '4': '....-', '5': '.....',
+ '6': '-....', '7': '--...', '8': '---..',
+ '9': '----.'
+ }
+
+ self.MORSE_CODE_DICT_INV = {v: k for k, v in self.MORSE_CODE_DICT.items()}
+ |
app.Decryptor.Encoding.encodingParent/EncodingParent.decrypt | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <1>:<add> torun = [self.base64, self.binary, self.hex, self.ascii, self.morse]
<del> torun = [self.base64, self.binary, self.hex, self.ascii]
| # module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
def decrypt(self, text):
<0> self.text = text
<1> torun = [self.base64, self.binary, self.hex, self.ascii]
<2> """
<3> ok so I have an array of functions
<4> and I want to apply each function to some text
<5> (text, function)
<6> but the way it works is you apply text to every item in the array (function)
<7>
<8> """
<9> from multiprocessing.dummy import Pool as ThreadPool
<10> pool = ThreadPool(4)
<11> answers = pool.map(self.callDecrypt, torun)
<12>
<13> for answer in answers:
<14> # adds the LC objects together
<15> self.lc = self.lc + answer["lc"]
<16> if answer["IsPlaintext?"]:
<17> return answer
<18> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
<19>
| ===========unchanged ref 0===========
at: Decryptor.Encoding.ascii
Ascii(lc)
at: Decryptor.Encoding.morsecode
MorseCode(lc)
at: app.Decryptor.Encoding.encodingParent.EncodingParent
callDecrypt(obj)
at: app.Decryptor.Encoding.encodingParent.EncodingParent.__init__
self.lc = lc
self.base64 = Base64(self.lc)
self.binary = Binary(self.lc)
self.hex = Hexadecimal(self.lc)
at: multiprocessing.dummy
Pool(processes: Optional[int]=..., initializer: Optional[Callable[..., Any]]=..., initargs: Iterable[Any]=...) -> Any
===========changed ref 0===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
def __init__(self, lc):
self.lc = lc
self.base64 = Base64(self.lc)
self.binary = Binary(self.lc)
self.hex = Hexadecimal(self.lc)
self.ascii = Ascii(self.lc)
+ self.morse = MorseCode(self.lc)
===========changed ref 1===========
+ # module: app.Decryptor.Encoding.morsecode
+
+
===========changed ref 2===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+
+
===========changed ref 3===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+ class PigLatin:
+ def __init__(self, lc):
+ self.lc = lc
+
===========changed ref 4===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def checkIfMorse(self, text):
+ return set(self.ALLOWED).issuperset(text)
+
===========changed ref 5===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+ def unmorse_it(self, text):
+ returnMsg = ""
+ for word in text.split('/'):
+ for char in word.strip().split():
+ # translates every letter
+ returnMsg += self.MORSE_CODE_DICT_INV[char]
+ # after every word add a space
+ returnMsg += " "
+ return returnMsg.strip().capitalize()
+
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
+ self.pig = PigLatin(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere]
===========changed ref 7===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 8===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def decrypt(self, text):
+ if not self.checkIfMorse(text):
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Morse Code", "Extra Information": None}
+ try:
+ result = self.unmorse_it(text)
+ except TypeError as e:
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Morse Code", "Extra Information": None}
+
+
+ return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": result, "Cipher": "Morse Code", "Extra Information": None}
+
===========changed ref 9===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
- print(answer)
return answer
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
===========changed ref 10===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+ def __init__(self, lc):
+ self.lc = lc
+ self.ALLOWED = [".", "-", " ", "/"]
+ self.MORSE_CODE_DICT = {'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': '--..',
+ '?': '..--..', '.': '.-.-.-', ' ': '/',
+ '0': '-----', '1': '.----', '2': '..---',
+ '3': '...--', '4': '....-', '5': '.....',
+ '6': '-....', '7': '--...', '8': '---..',
+ '9': '----.'
+ }
+
+ self.MORSE_CODE_DICT_INV = {v: k for k, v in self.MORSE_CODE_DICT.items()}
+ |
app.Tests.testcaesarcipher_basic/TestChi.test_caesar_plaintext_yes | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <6>:<add> self.assertEqual(result['IsPlaintext?'], True)
<del> self.assertEqual(result['IsPlaintext?'], False)
| # module: app.Tests.testcaesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
class TestChi(unittest.TestCase):
def test_caesar_plaintext_yes(self):
<0> """Checks to see if it returns True (it should)
<1> Ok so this returns false becaues caesar only does up to 25, not 26
<2> so plaintext returns false!"""
<3> lc = LanguageChecker()
<4> c = Caesar(lc)
<5> result = c.decrypt("What about plaintext?")
<6> self.assertEqual(result['IsPlaintext?'], False)
<7>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.caesar
Caesar(lc)
at: app.Decryptor.basicEncryption.caesar.Caesar
decrypt(message)
at: unittest.case.TestCase
failureException: Type[BaseException]
longMessage: bool
maxDiff: Optional[int]
_testMethodName: str
_testMethodDoc: str
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
+ # module: app.Decryptor.Encoding.morsecode
+
+
===========changed ref 1===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+
+
===========changed ref 2===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+ class PigLatin:
+ def __init__(self, lc):
+ self.lc = lc
+
===========changed ref 3===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def checkIfMorse(self, text):
+ return set(self.ALLOWED).issuperset(text)
+
===========changed ref 4===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
def __init__(self, lc):
self.lc = lc
self.base64 = Base64(self.lc)
self.binary = Binary(self.lc)
self.hex = Hexadecimal(self.lc)
self.ascii = Ascii(self.lc)
+ self.morse = MorseCode(self.lc)
===========changed ref 5===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("tsafkaerb hsilgne doog a ekil od yllaer i dna rehtom ym olleh rehtaf ym olleh")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 6===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes_2(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("sevom ylpmis rac eht ciffart ruoy lla gnillenut si hcihw redivorp NPV a ekilnU")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 7===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_caesar_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 8===========
# module: app.Tests.testEncoding
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
+ def test_morse(self):
+ lc = LanguageChecker()
+ ep = EncodingParent(lc)
+ a = ".... . .-.. .-.. --- / -- -.-- / -. .- -- . / .. ... / -... .-. .- -. -.. --- -."
+ result = ep.decrypt(a)
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 9===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+ def unmorse_it(self, text):
+ returnMsg = ""
+ for word in text.split('/'):
+ for char in word.strip().split():
+ # translates every letter
+ returnMsg += self.MORSE_CODE_DICT_INV[char]
+ # after every word add a space
+ returnMsg += " "
+ return returnMsg.strip().capitalize()
+
===========changed ref 10===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
+ self.pig = PigLatin(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere]
===========changed ref 11===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 12===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def decrypt(self, text):
+ if not self.checkIfMorse(text):
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Morse Code", "Extra Information": None}
+ try:
+ result = self.unmorse_it(text)
+ except TypeError as e:
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Morse Code", "Extra Information": None}
+
+
+ return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": result, "Cipher": "Morse Code", "Extra Information": None}
+ |
app.Tests.testcaesarcipher_basic/TestChi.test_caesar_english_comparison | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <3>:<add> self.assertEqual(result['IsPlaintext?'], True)
<del> self.assertEqual(result['Plaintext'], "If he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters of the alphabet, that not a word could be made out.".lower())
| # module: app.Tests.testcaesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
class TestChi(unittest.TestCase):
def test_caesar_english_comparison(self):
<0> lc = LanguageChecker()
<1> c = Caesar(lc)
<2> result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
<3> self.assertEqual(result['Plaintext'], "If he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters of the alphabet, that not a word could be made out.".lower())
<4>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.caesar
Caesar(lc)
at: app.Decryptor.basicEncryption.caesar.Caesar
decrypt(message)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.testcaesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
class TestChi(unittest.TestCase):
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
lc = LanguageChecker()
c = Caesar(lc)
result = c.decrypt("What about plaintext?")
+ self.assertEqual(result['IsPlaintext?'], True)
- self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 1===========
+ # module: app.Decryptor.Encoding.morsecode
+
+
===========changed ref 2===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+
+
===========changed ref 3===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+ class PigLatin:
+ def __init__(self, lc):
+ self.lc = lc
+
===========changed ref 4===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def checkIfMorse(self, text):
+ return set(self.ALLOWED).issuperset(text)
+
===========changed ref 5===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
def __init__(self, lc):
self.lc = lc
self.base64 = Base64(self.lc)
self.binary = Binary(self.lc)
self.hex = Hexadecimal(self.lc)
self.ascii = Ascii(self.lc)
+ self.morse = MorseCode(self.lc)
===========changed ref 6===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("tsafkaerb hsilgne doog a ekil od yllaer i dna rehtom ym olleh rehtaf ym olleh")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 7===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes_2(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("sevom ylpmis rac eht ciffart ruoy lla gnillenut si hcihw redivorp NPV a ekilnU")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 8===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_caesar_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 9===========
# module: app.Tests.testEncoding
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
+ def test_morse(self):
+ lc = LanguageChecker()
+ ep = EncodingParent(lc)
+ a = ".... . .-.. .-.. --- / -- -.-- / -. .- -- . / .. ... / -... .-. .- -. -.. --- -."
+ result = ep.decrypt(a)
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 10===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+ def unmorse_it(self, text):
+ returnMsg = ""
+ for word in text.split('/'):
+ for char in word.strip().split():
+ # translates every letter
+ returnMsg += self.MORSE_CODE_DICT_INV[char]
+ # after every word add a space
+ returnMsg += " "
+ return returnMsg.strip().capitalize()
+
===========changed ref 11===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
+ self.pig = PigLatin(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere]
===========changed ref 12===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
|
app.Tests.testdictionary_checker/TestChi.test_english_false_two | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <2>:<add> self.assertEqual(result, True)
<del> self.assertEqual(result, False)
| # module: app.Tests.testdictionary_checker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_false_two(self):
<0> dc = dictionaryChecker.dictionaryChecker()
<1> result = dc.confirmlanguage("pink jdajj red 9jjidasjp october whisky odiajdq", "English")
<2> self.assertEqual(result, False)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.dictionaryChecker
dictionaryChecker()
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker
confirmlanguage(text, language)
at: unittest.case.TestCase
failureException: Type[BaseException]
longMessage: bool
maxDiff: Optional[int]
_testMethodName: str
_testMethodDoc: str
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
+ # module: app.Decryptor.Encoding.morsecode
+
+
===========changed ref 1===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+
+
===========changed ref 2===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+ class PigLatin:
+ def __init__(self, lc):
+ self.lc = lc
+
===========changed ref 3===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def checkIfMorse(self, text):
+ return set(self.ALLOWED).issuperset(text)
+
===========changed ref 4===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
def __init__(self, lc):
self.lc = lc
self.base64 = Base64(self.lc)
self.binary = Binary(self.lc)
self.hex = Hexadecimal(self.lc)
self.ascii = Ascii(self.lc)
+ self.morse = MorseCode(self.lc)
===========changed ref 5===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("tsafkaerb hsilgne doog a ekil od yllaer i dna rehtom ym olleh rehtaf ym olleh")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 6===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes_2(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("sevom ylpmis rac eht ciffart ruoy lla gnillenut si hcihw redivorp NPV a ekilnU")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 7===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_caesar_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 8===========
# module: app.Tests.testEncoding
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
+ def test_morse(self):
+ lc = LanguageChecker()
+ ep = EncodingParent(lc)
+ a = ".... . .-.. .-.. --- / -- -.-- / -. .- -- . / .. ... / -... .-. .- -. -.. --- -."
+ result = ep.decrypt(a)
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 9===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+ def unmorse_it(self, text):
+ returnMsg = ""
+ for word in text.split('/'):
+ for char in word.strip().split():
+ # translates every letter
+ returnMsg += self.MORSE_CODE_DICT_INV[char]
+ # after every word add a space
+ returnMsg += " "
+ return returnMsg.strip().capitalize()
+
===========changed ref 10===========
# module: app.Tests.testcaesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
class TestChi(unittest.TestCase):
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
lc = LanguageChecker()
c = Caesar(lc)
result = c.decrypt("What about plaintext?")
+ self.assertEqual(result['IsPlaintext?'], True)
- self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 11===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
+ self.pig = PigLatin(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere]
===========changed ref 12===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
|
app.Tests.testdictionary_checker/TestChi.test_english_percentage | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <2>:<add> self.assertEqual(dc.languagePercentage, 90.0)
<del> self.assertEqual(dc.languagePercentage, 80.0)
| # module: app.Tests.testdictionary_checker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_percentage(self):
<0> dc = dictionaryChecker.dictionaryChecker()
<1> result = dc.confirmlanguage("The password for my computer is tyu456q and the username is admin", "English")
<2> self.assertEqual(dc.languagePercentage, 80.0)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.dictionaryChecker
dictionaryChecker()
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker
confirmlanguage(text, language)
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker.__init__
self.languagePercentage = 0.0
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker.checkDictionary
self.languagePercentage = self.mh.percentage(float(self.languageWordsCounter), float(len(text)))
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.testdictionary_checker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_false_two(self):
dc = dictionaryChecker.dictionaryChecker()
result = dc.confirmlanguage("pink jdajj red 9jjidasjp october whisky odiajdq", "English")
+ self.assertEqual(result, True)
- self.assertEqual(result, False)
===========changed ref 1===========
+ # module: app.Decryptor.Encoding.morsecode
+
+
===========changed ref 2===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+
+
===========changed ref 3===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+ class PigLatin:
+ def __init__(self, lc):
+ self.lc = lc
+
===========changed ref 4===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def checkIfMorse(self, text):
+ return set(self.ALLOWED).issuperset(text)
+
===========changed ref 5===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
def __init__(self, lc):
self.lc = lc
self.base64 = Base64(self.lc)
self.binary = Binary(self.lc)
self.hex = Hexadecimal(self.lc)
self.ascii = Ascii(self.lc)
+ self.morse = MorseCode(self.lc)
===========changed ref 6===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("tsafkaerb hsilgne doog a ekil od yllaer i dna rehtom ym olleh rehtaf ym olleh")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 7===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes_2(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("sevom ylpmis rac eht ciffart ruoy lla gnillenut si hcihw redivorp NPV a ekilnU")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 8===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_caesar_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 9===========
# module: app.Tests.testEncoding
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
+ def test_morse(self):
+ lc = LanguageChecker()
+ ep = EncodingParent(lc)
+ a = ".... . .-.. .-.. --- / -- -.-- / -. .- -- . / .. ... / -... .-. .- -. -.. --- -."
+ result = ep.decrypt(a)
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 10===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+ def unmorse_it(self, text):
+ returnMsg = ""
+ for word in text.split('/'):
+ for char in word.strip().split():
+ # translates every letter
+ returnMsg += self.MORSE_CODE_DICT_INV[char]
+ # after every word add a space
+ returnMsg += " "
+ return returnMsg.strip().capitalize()
+
===========changed ref 11===========
# module: app.Tests.testcaesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
class TestChi(unittest.TestCase):
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
lc = LanguageChecker()
c = Caesar(lc)
result = c.decrypt("What about plaintext?")
+ self.assertEqual(result['IsPlaintext?'], True)
- self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 12===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
+ self.pig = PigLatin(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere]
|
app.Tests.testdictionary_checker/TestChi.test_english_perfect | Modified | Ciphey~Ciphey | a50afcd024452067520788b2ba815eb77fb6eb2b | added morse code and pig latin | <1>:<add> result = dc.confirmlanguage("Archimedes famously said: “Give me a lever long enough and a fulcrum on which to place it, and I shall move the world.” But what we are talking about here is not physical leverage. It is the leverage of ideas. When you create content, people can access your knowledge without taking your time. You no longer need to sell knowledge by the hour. Your ideas are the most valuable currency in a knowledge-driven economy. Just as an investment account allows your money to grow day and night without your involvement, content does the same with your ideas. Until recently, the average person wasn’t able to publish and distribute their ideas at a reasonable cost. But on the Internet, anybody, in any corner of the world, in any time zone, can access your best thinking. 24 hours a day. 7 days a week. 365 days a year. When you publish ideas, you create your own “Serendipity Vehicle” – a magnet for ideas | # module: app.Tests.testdictionary_checker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_perfect(self):
<0> dc = dictionaryChecker.dictionaryChecker()
<1> result = dc.confirmlanguage("If your school lends textbooks, teachers seem perfectly content in using ones published in 1999. If your school sells textbooks, then last year’s editions are suddenly outdated, worthless pieces of trash.", "English")
<2> self.assertEqual(result, True)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.dictionaryChecker
dictionaryChecker()
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker
confirmlanguage(text, language)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.testdictionary_checker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_percentage(self):
dc = dictionaryChecker.dictionaryChecker()
result = dc.confirmlanguage("The password for my computer is tyu456q and the username is admin", "English")
+ self.assertEqual(dc.languagePercentage, 90.0)
- self.assertEqual(dc.languagePercentage, 80.0)
===========changed ref 1===========
# module: app.Tests.testdictionary_checker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_false_two(self):
dc = dictionaryChecker.dictionaryChecker()
result = dc.confirmlanguage("pink jdajj red 9jjidasjp october whisky odiajdq", "English")
+ self.assertEqual(result, True)
- self.assertEqual(result, False)
===========changed ref 2===========
+ # module: app.Decryptor.Encoding.morsecode
+
+
===========changed ref 3===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+
+
===========changed ref 4===========
+ # module: app.Decryptor.basicEncryption.pigLatin
+ class PigLatin:
+ def __init__(self, lc):
+ self.lc = lc
+
===========changed ref 5===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+
+ def checkIfMorse(self, text):
+ return set(self.ALLOWED).issuperset(text)
+
===========changed ref 6===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
def __init__(self, lc):
self.lc = lc
self.base64 = Base64(self.lc)
self.binary = Binary(self.lc)
self.hex = Hexadecimal(self.lc)
self.ascii = Ascii(self.lc)
+ self.morse = MorseCode(self.lc)
===========changed ref 7===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("tsafkaerb hsilgne doog a ekil od yllaer i dna rehtom ym olleh rehtaf ym olleh")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 8===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_reverse_yes_2(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("sevom ylpmis rac eht ciffart ruoy lla gnillenut si hcihw redivorp NPV a ekilnU")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 9===========
# module: app.Tests.testbasic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
+ def test_basic_parent_caesar_yes(self):
+ lc = LanguageChecker()
+ bp = BasicParent(lc)
+ result = bp.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 10===========
# module: app.Tests.testEncoding
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
+ def test_morse(self):
+ lc = LanguageChecker()
+ ep = EncodingParent(lc)
+ a = ".... . .-.. .-.. --- / -- -.-- / -. .- -- . / .. ... / -... .-. .- -. -.. --- -."
+ result = ep.decrypt(a)
+ self.assertEqual(result['IsPlaintext?'], True)
+
===========changed ref 11===========
+ # module: app.Decryptor.Encoding.morsecode
+ class MorseCode:
+ def unmorse_it(self, text):
+ returnMsg = ""
+ for word in text.split('/'):
+ for char in word.strip().split():
+ # translates every letter
+ returnMsg += self.MORSE_CODE_DICT_INV[char]
+ # after every word add a space
+ returnMsg += " "
+ return returnMsg.strip().capitalize()
+
===========changed ref 12===========
# module: app.Tests.testcaesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
class TestChi(unittest.TestCase):
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
lc = LanguageChecker()
c = Caesar(lc)
result = c.decrypt("What about plaintext?")
+ self.assertEqual(result['IsPlaintext?'], True)
- self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 13===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
+ self.pig = PigLatin(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere]
|
app.Decryptor.basicEncryption.transposition/Transposition.decrypt | Modified | Ciphey~Ciphey | 34ab22eed21fb9e856386ee5b3a120925488d9fd | added affine cipher | <1>:<add> for key in range(1, len(text)):
<del> for key in range(1, len(message)):
<2>:<add> decryptedText = self.decryptMessage(key, text)
<del> decryptedText = self.decryptMessage(key, message)
<3>:<add> if self.lc.checkLanguage(decryptedText):
<add> return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
<del> if self.lc.
<5>:<del> # Python programs can be stopped at any time by pressing Ctrl-C (on
<6>:<del> # Windows) or Ctrl-D (on Mac and Linux)
<7>:<del> print('(Press Ctrl-C or Ctrl-D to quit at any time.)')
<8>:<del>
<9>:<del> # Brute-force by looping through every possible key.
<10>:<del> for key in range(1, len(message)):
<11>:<del> print('Trying key #%s...' % (key))
<12>:<del>
<13>:<del> decryptedText = transpositionDecrypt.decryptMessage(key, message)
<14>:<del>
<15>:<del> if detectEnglish.isEnglish(decryptedText):
<16>:<del> # Ask user if this is the correct decryption.
<17>:<del> print()
<18>:<del> print('Possible encryption hack:')
<19>:<del> print('Key %s: %s' % (key, decryptedText[:100]))
<20>:<del> print()
<21>:<del> print('Enter D if done, anything else to continue hacking:')
<22>:<del> response = input('> ')
<23>:<del>
<24>:<del> if response.strip().upper().startswith('D'):
<25>:<del> return decryptedText
<26>:<del>
<27>:<del> return None
<28>:<add> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
| # module: app.Decryptor.basicEncryption.transposition
+
class Transposition:
def decrypt(self, text):
<0> # Brute-force by looping through every possible key.
<1> for key in range(1, len(message)):
<2> decryptedText = self.decryptMessage(key, message)
<3> if self.lc.
<4>
<5> # Python programs can be stopped at any time by pressing Ctrl-C (on
<6> # Windows) or Ctrl-D (on Mac and Linux)
<7> print('(Press Ctrl-C or Ctrl-D to quit at any time.)')
<8>
<9> # Brute-force by looping through every possible key.
<10> for key in range(1, len(message)):
<11> print('Trying key #%s...' % (key))
<12>
<13> decryptedText = transpositionDecrypt.decryptMessage(key, message)
<14>
<15> if detectEnglish.isEnglish(decryptedText):
<16> # Ask user if this is the correct decryption.
<17> print()
<18> print('Possible encryption hack:')
<19> print('Key %s: %s' % (key, decryptedText[:100]))
<20> print()
<21> print('Enter D if done, anything else to continue hacking:')
<22> response = input('> ')
<23>
<24> if response.strip().upper().startswith('D'):
<25> return decryptedText
<26>
<27> return None
<28>
| ===========unchanged ref 0===========
at: math
ceil(x: SupportsFloat, /) -> int
===========changed ref 0===========
# module: app.mathsHelper
class mathsHelper:
+ def gcd(self, a, b):
+ # Return the Greatest Common Divisor of a and b using Euclid's Algorithm
+ while a != 0:
+ a, b = b % a, a
+ return b
+
===========changed ref 1===========
# module: app.mathsHelper
class mathsHelper:
+ def findModInverse(self, a, m):
+ # Return the modular inverse of a % m, which is
+ # the number x such that a*x % m = 1
+
+ if gcd(a, m) != 1:
+ return None # No mod inverse exists if a & m aren't relatively prime.
+
+ # Calculate using the Extended Euclidean Algorithm:
+ u1, u2, u3 = 1, 0, a
+ v1, v2, v3 = 0, 1, m
+ while v3 != 0:
+ q = u3 // v3 # Note that // is the integer division operator
+ v1, v2, v3, u1, u2, u3 = (u1 - q * v1), (u2 - q * v2), (u3 - q * v3), v1, v2, v3
+ return u1 % m
+ |
app.Decryptor.basicEncryption.basic_parent/BasicParent.__init__ | Modified | Ciphey~Ciphey | 34ab22eed21fb9e856386ee5b3a120925488d9fd | added affine cipher | <5>:<add> self.trans = Transposition(self.lc)
<6>:<add> self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
<del> self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
| # module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
<0> self.lc = lc
<1> self.caesar = Caesar(self.lc)
<2> self.reverse = Reverse(self.lc)
<3> self.viginere = Viginere(self.lc)
<4> self.pig = PigLatin(self.lc)
<5>
<6> self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig]
<7>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.caesar
Caesar(lc)
at: Decryptor.basicEncryption.pigLatin
PigLatin(lc)
at: Decryptor.basicEncryption.reverse
Reverse(lc)
at: Decryptor.basicEncryption.transposition
Transposition(lc)
at: Decryptor.basicEncryption.viginere
Viginere(lc)
at: app.Decryptor.basicEncryption.basic_parent.BasicParent.decrypt
self.lc = self.lc + answer["lc"]
===========changed ref 0===========
+ # module: app.Decryptor.basicEncryption.affine
+
+
===========changed ref 1===========
+ # module: app.Decryptor.basicEncryption.affine
+ class Affine:
+
+ def getKeyParts(self, key):
+ keyA = key // len(SYMBOLS)
+ keyB = key % len(SYMBOLS)
+ return (keyA, keyB)
+
===========changed ref 2===========
# module: app.mathsHelper
class mathsHelper:
+ def gcd(self, a, b):
+ # Return the Greatest Common Divisor of a and b using Euclid's Algorithm
+ while a != 0:
+ a, b = b % a, a
+ return b
+
===========changed ref 3===========
+ # module: app.Decryptor.basicEncryption.affine
+ class Affine:
+ def __init__(self, lc):
+ self.lc = lc
+ self.mh = mathsHelper()
+ self.SYMBOLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 !?.'
+
===========changed ref 4===========
+ # module: app.Decryptor.basicEncryption.affine
+ class Affine:
+ def decryptMessage(self, key, message):
+ keyA, keyB = getKeyParts(key)
+ self.checkKeys(keyA, keyB, 'decrypt')
+ plaintext = ''
+ modInverseOfKeyA = self.mh.findModInverse(keyA, len(SYMBOLS))
+
+ for symbol in message:
+ if symbol in self.SYMBOLS:
+ # Decrypt the symbol:
+ symbolIndex = self.SYMBOLS.find(symbol)
+ plaintext += self.SYMBOLS[(symbolIndex - keyB) * modInverseOfKeyA % len(self.SYMBOLS)]
+ else:
+ plaintext += symbol # Append the symbol without decrypting.
+ return plaintext
+
===========changed ref 5===========
+ # module: app.Decryptor.basicEncryption.affine
+ class Affine:
+ def checkKeys(self, keyA, keyB, mode):
+ if keyA == 1 and mode == 'encrypt':
+ sys.exit('Cipher is weak if key A is 1. Choose a different key.')
+ if keyB == 0 and mode == 'encrypt':
+ sys.exit('Cipher is weak if key B is 0. Choose a different key.')
+ if keyA < 0 or keyB < 0 or keyB > len(SYMBOLS) - 1:
+ sys.exit('Key A must be greater than 0 and Key B must be between 0 and %s.' % (len(SYMBOLS) - 1))
+ if cryptomath.gcd(keyA, len(SYMBOLS)) != 1:
+ sys.exit('Key A (%s) and the symbol set size (%s) are not relatively prime. Choose a different key.' % (keyA, len(SYMBOLS)))
+
===========changed ref 6===========
+ # module: app.Decryptor.basicEncryption.affine
+ class Affine:
+
+ def decrypt(self, text):
+ # Brute-force by looping through every possible key
+ for key in range(len(self.SYMBOLS) ** 2):
+ keyA = self.getKeyParts(key)[0]
+ if self.mh.gcd(keyA, len(self.SYMBOLS)) != 1:
+ continue
+ decryptedText = self.decryptMessage(key, message)
+
+ if self.lc.checkLanguage(decryptedText):
+ return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Affine", "Extra Information": f"The key used is {key}"}
+
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Affine", "Extra Information": None}
+
===========changed ref 7===========
# module: app.mathsHelper
class mathsHelper:
+ def findModInverse(self, a, m):
+ # Return the modular inverse of a % m, which is
+ # the number x such that a*x % m = 1
+
+ if gcd(a, m) != 1:
+ return None # No mod inverse exists if a & m aren't relatively prime.
+
+ # Calculate using the Extended Euclidean Algorithm:
+ u1, u2, u3 = 1, 0, a
+ v1, v2, v3 = 0, 1, m
+ while v3 != 0:
+ q = u3 // v3 # Note that // is the integer division operator
+ v1, v2, v3, u1, u2, u3 = (u1 - q * v1), (u2 - q * v2), (u3 - q * v3), v1, v2, v3
+ return u1 % m
+
===========changed ref 8===========
# module: app.Decryptor.basicEncryption.transposition
+
class Transposition:
def decrypt(self, text):
# Brute-force by looping through every possible key.
+ for key in range(1, len(text)):
- for key in range(1, len(message)):
+ decryptedText = self.decryptMessage(key, text)
- decryptedText = self.decryptMessage(key, message)
+ if self.lc.checkLanguage(decryptedText):
+ return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
- if self.lc.
- # Python programs can be stopped at any time by pressing Ctrl-C (on
- # Windows) or Ctrl-D (on Mac and Linux)
- print('(Press Ctrl-C or Ctrl-D to quit at any time.)')
-
- # Brute-force by looping through every possible key.
- for key in range(1, len(message)):
- print('Trying key #%s...' % (key))
-
- decryptedText = transpositionDecrypt.decryptMessage(key, message)
-
- if detectEnglish.isEnglish(decryptedText):
- # Ask user if this is the correct decryption.
- print()
- print('Possible encryption hack:')
- print('Key %s: %s' % (key, decryptedText[:100]))
- print()
- print('Enter D if done, anything else to continue hacking:')
- response = input('> ')
-
- if response.strip().upper().startswith('D'):
- return decryptedText
-
- return None
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
|
app.Decryptor.basicEncryption.reverse/Reverse.__init__ | Modified | Ciphey~Ciphey | 8fef7c94d19e81049be73e0015ea1389192cc8ae | fixed main | <1>:<add> self.mh = mathsHelper.mathsHelper()
| # module: app.Decryptor.basicEncryption.reverse
class Reverse:
def __init__(self, lc):
<0> self.lc = lc
<1>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.reverse
Reverse(lc)
===========changed ref 0===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
+ def setProbTable(self, table):
+ pass
+
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.affine
class Affine:
+ def getName(self):
+ return "Affine"
+ |
app.Decryptor.basicEncryption.reverse/Reverse.decrypt | Modified | Ciphey~Ciphey | 8fef7c94d19e81049be73e0015ea1389192cc8ae | fixed main | <0>:<add> message = self.mh.stripPuncuation(message)
<add>
| # module: app.Decryptor.basicEncryption.reverse
class Reverse:
def decrypt(self, message):
<0> message = message[::-1]
<1> result = self.lc.checkLanguage(message)
<2> if result:
<3> return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": message, "Cipher": "Reverse", "Extra Information": None}
<4> else:
<5> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Reverse", "Extra Information": None}
<6>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.reverse.Reverse.__init__
self.lc = lc
at: mathsHelper
mathsHelper()
at: mathsHelper.mathsHelper
stripPuncuation(text)
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.reverse
class Reverse:
def __init__(self, lc):
self.lc = lc
+ self.mh = mathsHelper.mathsHelper()
===========changed ref 1===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
+ def setProbTable(self, table):
+ pass
+
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.affine
class Affine:
+ def getName(self):
+ return "Affine"
+ |
app.main/Ciphey.one_level_of_decryption | Modified | Ciphey~Ciphey | 8fef7c94d19e81049be73e0015ea1389192cc8ae | fixed main | <7>:<add> print("No encryption found. Here's the probabilities we calculated")
<add> import pprint
<add> pprint.pprint(self.whatToChoose)
| # module: app.main
class Ciphey:
def one_level_of_decryption(self):
<0> for key, val in self.whatToChoose.items():
<1> # https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string
<2> if not isinstance(key, str):
<3> key.setProbTable(val)
<4> ret = key.decrypt(self.text)
<5> if ret['IsPlaintext?']:
<6> print(ret)
<7>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.basic_parent.BasicParent
decrypt(text)
setProbTable(prob)
at: app.main.Ciphey.__init__
self.text = text
at: app.main.Ciphey.decrypt
self.whatToChoose = {self.hash:
{
"sha1": self.probabilityDistribution[0],
"md5": self.probabilityDistribution[1],
"sha256": self.probabilityDistribution[2],
"sha512": self.probabilityDistribution[3]
},
self.basic: {
"caesar": self.probabilityDistribution[4]
},
"plaintext":{
"plaintext": self.probabilityDistribution[5]
}
}
self.whatToChoose = new_dict
at: collections.OrderedDict
update = __update = _collections_abc.MutableMapping.update
update = __update = _collections_abc.MutableMapping.update
items() -> _OrderedDictItemsView[_KT, _VT]
__ne__ = _collections_abc.MutableMapping.__ne__
__marker = object()
===========changed ref 0===========
# module: app.main
class Ciphey:
def decrypt(self):
"""
this method calls 1 level of decrypt
The idea is that so long as decrypt doesnt return the plaintext
to carry on decrypting all subsets of the text until we find one that does decrypt properly
maybe only 2 levels
The way probability distribution works is something like this:
{Encoding: {"Binary": 0.137, "Base64": 0.09, "Hexadecimal": 0.00148}, Hashes: {"SHA1": 0.0906, "MD5": 0.98}}
If an item in the dictionary is == 0.00 then write it down as 0.001
Each parental dictiony object (eg encoding, hashing) is the actual object
So each decipherment class has a parent that controls all of it
sha1, sha256, md5, sha512 etc all belong to the object "hashes"
Ciphey passes each probability to these classes
Sort the dictionary
"""
self.probabilityDistribution = self.ai.predictnn(self.text)[0]
self.whatToChoose = {self.hash:
{
"sha1": self.probabilityDistribution[0],
"md5": self.probabilityDistribution[1],
"sha256": self.probabilityDistribution[2],
"sha512": self.probabilityDistribution[3]
},
self.basic: {
"caesar": self.probabilityDistribution[4]
},
+ self.encoding:{
- "plaintext":{
</s>
===========changed ref 1===========
# module: app.main
class Ciphey:
def decrypt(self):
# offset: 1
<s>": self.probabilityDistribution[4]
},
+ self.encoding:{
- "plaintext":{
"plaintext": self.probabilityDistribution[5]
}
}
# sorts each indiviudal sub-dictionary
for key, value in self.whatToChoose.items():
for k, v in value.items():
if v < 0.01:
self.whatToChoose[key][k] = 0.01
for key, value in self.whatToChoose.items():
self.whatToChoose[key] = self.mh.sortDictionary(value)
# the below code selects the most likely one
# and places it at the front
new_dict = {}
maximum = 0.00
max_key = None
max_val = None
for key, value in self.whatToChoose.items():
val = next(iter(value))
val = value[val]
if val >= maximum:
maximum = val
max_key = key
max_val = value
new_dict = collections.OrderedDict()
new_dict[max_key] = max_val
"""
find key in the main dict, delete it
go through that dict and add each component to the end of this dict?
"""
temp = self.whatToChoose
for key, value in self.whatToChoose.items():
if key == max_key:
continue
new_dict[key] = value
# ok so this looks wacky but hear me out here
# a.update(b)
# adds all content of dict b onto end of dict a
# no way to add it to</s>
===========changed ref 2===========
# module: app.main
class Ciphey:
def decrypt(self):
# offset: 2
<s> so I have to do this :)
self.whatToChoose = new_dict
"""
for each dictionary in the dictionary
sort that dictionary
sort the overall dictionary by the first value of the new dictionary
"""
self.one_level_of_decryption()
===========changed ref 3===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
+ def setProbTable(self, table):
+ pass
+
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.affine
class Affine:
+ def getName(self):
+ return "Affine"
+
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.reverse
class Reverse:
def __init__(self, lc):
self.lc = lc
+ self.mh = mathsHelper.mathsHelper()
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.reverse
class Reverse:
def decrypt(self, message):
+ message = self.mh.stripPuncuation(message)
+
message = message[::-1]
result = self.lc.checkLanguage(message)
if result:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": message, "Cipher": "Reverse", "Extra Information": None}
else:
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Reverse", "Extra Information": None}
|
app.Decryptor.basicEncryption.viginere/Viginere.__init__ | Modified | Ciphey~Ciphey | 8fef7c94d19e81049be73e0015ea1389192cc8ae | fixed main | <3>:<add> self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
<del> self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
<0> self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
<1> self.SILENT_MODE = True # If set to True, program doesn't print anything.
<2> self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
<3> self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
<4> self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
<5>
<6> self.lc = lc
<7>
| ===========unchanged ref 0===========
at: re
compile(pattern: AnyStr, flags: _FlagsType=...) -> Pattern[AnyStr]
compile(pattern: Pattern[AnyStr], flags: _FlagsType=...) -> Pattern[AnyStr]
===========changed ref 0===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
+ def setProbTable(self, table):
+ pass
+
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.affine
class Affine:
+ def getName(self):
+ return "Affine"
+
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.reverse
class Reverse:
def __init__(self, lc):
self.lc = lc
+ self.mh = mathsHelper.mathsHelper()
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.reverse
class Reverse:
def decrypt(self, message):
+ message = self.mh.stripPuncuation(message)
+
message = message[::-1]
result = self.lc.checkLanguage(message)
if result:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": message, "Cipher": "Reverse", "Extra Information": None}
else:
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Reverse", "Extra Information": None}
===========changed ref 4===========
# module: app.main
class Ciphey:
def one_level_of_decryption(self):
for key, val in self.whatToChoose.items():
# https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string
if not isinstance(key, str):
key.setProbTable(val)
ret = key.decrypt(self.text)
if ret['IsPlaintext?']:
print(ret)
+ print("No encryption found. Here's the probabilities we calculated")
+ import pprint
+ pprint.pprint(self.whatToChoose)
===========changed ref 5===========
# module: app.main
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Blog')
parser.add_argument('-f','--file', help='File you want to decrypt', required=False)
parser.add_argument('-l','--level', help='How many levels of decryption you want (the more levels, the slower it is)', required=False)
parser.add_argument('-g','--greppable', help='Are you grepping this output?', required=False)
parser.add_argument('-t','--text', help='Text to decrypt', required=False)
args = vars(parser.parse_args())
print("""
██████╗██╗██████╗ ██╗ ██╗███████╗██╗ ██╗
██╔════╝██║██╔══██╗██║ ██║██╔════╝╚██╗ ██╔╝
██║ ██║██████╔╝███████║████</s>
===========changed ref 6===========
# module: app.main
# offset: 1
<s>█████║█████╗ ╚████╔╝
██║ ██║██╔═══╝ ██╔══██║██╔══╝ ╚██╔╝
╚██████╗██║██║ ██║ ██║███████╗ ██║
Made by Brandon Skerritt""")
#uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg
+ cipherObj = Ciphey("racecar")
- cipherObj = Ciphey("AAF4C61DDCC5E8A2DABEDE0F3B482CD9AEA9434D")
cipherObj.decrypt()
===========changed ref 7===========
# module: app.main
class Ciphey:
def decrypt(self):
"""
this method calls 1 level of decrypt
The idea is that so long as decrypt doesnt return the plaintext
to carry on decrypting all subsets of the text until we find one that does decrypt properly
maybe only 2 levels
The way probability distribution works is something like this:
{Encoding: {"Binary": 0.137, "Base64": 0.09, "Hexadecimal": 0.00148}, Hashes: {"SHA1": 0.0906, "MD5": 0.98}}
If an item in the dictionary is == 0.00 then write it down as 0.001
Each parental dictiony object (eg encoding, hashing) is the actual object
So each decipherment class has a parent that controls all of it
sha1, sha256, md5, sha512 etc all belong to the object "hashes"
Ciphey passes each probability to these classes
Sort the dictionary
"""
self.probabilityDistribution = self.ai.predictnn(self.text)[0]
self.whatToChoose = {self.hash:
{
"sha1": self.probabilityDistribution[0],
"md5": self.probabilityDistribution[1],
"sha256": self.probabilityDistribution[2],
"sha512": self.probabilityDistribution[3]
},
self.basic: {
"caesar": self.probabilityDistribution[4]
},
+ self.encoding:{
- "plaintext":{
</s> |
app.Decryptor.basicEncryption.viginere/Viginere.attemptHackWithKeyLength | Modified | Ciphey~Ciphey | 8fef7c94d19e81049be73e0015ea1389192cc8ae | fixed main | # module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
<0> # Determine the most likely letters for each letter in the key:
<1> ciphertextUp = ciphertext.upper()
<2> # allFreqScores is a list of mostLikelyKeyLength number of lists.
<3> # These inner lists are the freqScores lists.
<4> allFreqScores = []
<5> for nth in range(1, mostLikelyKeyLength + 1):
<6> nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
<7>
<8> # freqScores is a list of tuples like:
<9> # [(<letter>, <Eng. Freq. match score>), ... ]
<10> # List is sorted by match score. Higher score means better match.
<11> # See the englishFreqMatchScore() comments in freqAnalysis.py.
<12> freqScores = []
<13> for possibleKey in self.LETTERS:
<14> decryptedText = self.decryptMessage(possibleKey, nthLetters)
<15> keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
<16> freqScores.append(keyAndFreqMatchTuple)
<17> # Sort by match score:
<18> freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
<19>
<20> allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
<21>
<22> if not self.SILENT_MODE:
<23> for i in range(len(allFreqScores)):
<24> # Use i + 1 so the first letter is not called the "0th" letter:
<25> print('Possible letters for letter %s of the key: ' % (i + 1), end='')
<26> for freqScore in allFreqScores[i]:
<27> print('%s ' % freqScore[0], end='')
<28> print() # Print a newline</s> | ===========below chunk 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 1
# Try every combination of the most likely letters for each position
# in the key:
for indexes in itertools.product(range(self.NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
# Create a possible key from the letters in allFreqScores:
possibleKey = ''
for i in range(mostLikelyKeyLength):
possibleKey += allFreqScores[i][indexes[i]][0]
if not self.SILENT_MODE:
print('Attempting with key: %s' % (possibleKey))
decryptedText = self.decryptMessage(possibleKey, ciphertextUp)
if self.lc.checkLanguage(decryptedText):
# Set the hacked ciphertext to the original casing:
origCase = []
for i in range(len(ciphertext)):
if ciphertext[i].isupper():
origCase.append(decryptedText[i].upper())
else:
origCase.append(decryptedText[i].lower())
decryptedText = ''.join(origCase)
# Check with user to see if the key has been found:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Viginere", "Extra Information": f"The key used is {possibleKey}"}
# No English-looking decryption found, so return None:
return None
===========unchanged ref 0===========
at: Decryptor.basicEncryption.freqAnalysis
englishFreqMatchScore(message)
at: app.Decryptor.basicEncryption.viginere.Viginere
getItemAtIndexOne(items)
getNthSubkeysLetters(nth, keyLength, message)
decryptMessage(key, message)
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
self.lc = lc
===========unchanged ref 1===========
at: itertools
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]
product(*iterables: Iterable[_T1], repeat: int) -> Iterator[Tuple[_T1, ...]]
product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]
product(*iterables: Iterable[Any], repeat: int=...) -> Iterator[Tuple[Any, ...]]
product(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any], iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any], iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 10 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 1===========
# module: app.Decryptor.Encoding.encodingParent
class EncodingParent:
+ def setProbTable(self, table):
+ pass
+
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.affine
class Affine:
+ def getName(self):
+ return "Affine"
+
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.reverse
class Reverse:
def __init__(self, lc):
self.lc = lc
+ self.mh = mathsHelper.mathsHelper()
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.reverse
class Reverse:
def decrypt(self, message):
+ message = self.mh.stripPuncuation(message)
+
message = message[::-1]
result = self.lc.checkLanguage(message)
if result:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": message, "Cipher": "Reverse", "Extra Information": None}
else:
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Reverse", "Extra Information": None}
===========changed ref 5===========
# module: app.main
class Ciphey:
def one_level_of_decryption(self):
for key, val in self.whatToChoose.items():
# https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string
if not isinstance(key, str):
key.setProbTable(val)
ret = key.decrypt(self.text)
if ret['IsPlaintext?']:
print(ret)
+ print("No encryption found. Here's the probabilities we calculated")
+ import pprint
+ pprint.pprint(self.whatToChoose)
|
|
app.Decryptor.basicEncryption.viginere/Viginere.__init__ | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <3>:<add> self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
<del> self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
<0> self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
<1> self.SILENT_MODE = True # If set to True, program doesn't print anything.
<2> self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
<3> self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
<4> self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
<5>
<6> self.lc = lc
<7>
| ===========unchanged ref 0===========
at: re
compile(pattern: AnyStr, flags: _FlagsType=...) -> Pattern[AnyStr]
compile(pattern: Pattern[AnyStr], flags: _FlagsType=...) -> Pattern[AnyStr]
|
app.Decryptor.basicEncryption.viginere/Viginere.attemptHackWithKeyLength | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | # module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
<0> # Determine the most likely letters for each letter in the key:
<1> ciphertextUp = ciphertext.upper()
<2> # allFreqScores is a list of mostLikelyKeyLength number of lists.
<3> # These inner lists are the freqScores lists.
<4> allFreqScores = []
<5> for nth in range(1, mostLikelyKeyLength + 1):
<6> nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
<7>
<8> # freqScores is a list of tuples like:
<9> # [(<letter>, <Eng. Freq. match score>), ... ]
<10> # List is sorted by match score. Higher score means better match.
<11> # See the englishFreqMatchScore() comments in freqAnalysis.py.
<12> freqScores = []
<13> for possibleKey in self.LETTERS:
<14> decryptedText = self.decryptMessage(possibleKey, nthLetters)
<15> keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
<16> freqScores.append(keyAndFreqMatchTuple)
<17> # Sort by match score:
<18> freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
<19>
<20> allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
<21>
<22> if not self.SILENT_MODE:
<23> for i in range(len(allFreqScores)):
<24> # Use i + 1 so the first letter is not called the "0th" letter:
<25> print('Possible letters for letter %s of the key: ' % (i + 1), end='')
<26> for freqScore in allFreqScores[i]:
<27> print('%s ' % freqScore[0], end='')
<28> print() # Print a newline</s> | ===========below chunk 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 1
# Try every combination of the most likely letters for each position
# in the key:
for indexes in itertools.product(range(self.NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
# Create a possible key from the letters in allFreqScores:
possibleKey = ''
for i in range(mostLikelyKeyLength):
possibleKey += allFreqScores[i][indexes[i]][0]
if not self.SILENT_MODE:
print('Attempting with key: %s' % (possibleKey))
decryptedText = self.decryptMessage(possibleKey, ciphertextUp)
if self.lc.checkLanguage(decryptedText):
# Set the hacked ciphertext to the original casing:
origCase = []
for i in range(len(ciphertext)):
if ciphertext[i].isupper():
origCase.append(decryptedText[i].upper())
else:
origCase.append(decryptedText[i].lower())
decryptedText = ''.join(origCase)
# Check with user to see if the key has been found:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Viginere", "Extra Information": f"The key used is {possibleKey}"}
# No English-looking decryption found, so return None:
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Pig Latin", "Extra Information": None}
===========unchanged ref 0===========
at: Decryptor.basicEncryption.freqAnalysis
englishFreqMatchScore(message)
at: app.Decryptor.basicEncryption.viginere.Viginere
getItemAtIndexOne(items)
getNthSubkeysLetters(nth, keyLength, message)
decryptMessage(key, message)
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
self.lc = lc
===========unchanged ref 1===========
at: itertools
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]
product(*iterables: Iterable[_T1], repeat: int) -> Iterator[Tuple[_T1, ...]]
product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]
product(*iterables: Iterable[Any], repeat: int=...) -> Iterator[Tuple[Any, ...]]
product(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any], iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any], iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
|
|
app.Decryptor.Hash.hashBuster/crack | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <27>:<del> if not file:
<28>:<add> return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
<del> return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually c
| # module: app.Decryptor.Hash.hashBuster
def crack(hashvalue):
<0> result = False
<1> if len(hashvalue) == 32:
<2> for api in md5:
<3> r = api(hashvalue, 'md5')
<4> if r:
<5> return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "md5", "Extra Information": None}
<6> elif len(hashvalue) == 40:
<7> for api in sha1:
<8> r = api(hashvalue, 'sha1')
<9> if r:
<10> return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha1", "Extra Information": None}
<11> elif len(hashvalue) == 64:
<12> for api in sha256:
<13> r = api(hashvalue, 'sha256')
<14> if r:
<15> return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha256", "Extra Information": None}
<16> elif len(hashvalue) == 96:
<17> for api in sha384:
<18> r = api(hashvalue, 'sha384')
<19> if r:
<20> return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha384", "Extra Information": None}
<21> elif len(hashvalue) == 128:
<22> for api in sha512:
<23> r = api(hashvalue, 'sha512')
<24> if r:
<25> return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha512", "Extra Information": None}
<26> else:
<27> if not file:
<28> return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually c</s> | ===========below chunk 0===========
# module: app.Decryptor.Hash.hashBuster
def crack(hashvalue):
# offset: 1
else:
return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
===========unchanged ref 0===========
at: app.Decryptor.Hash.hashBuster
thread_count = 4
crack(hashvalue)
at: concurrent.futures._base
as_completed(fs: Iterable[Future[_T]], timeout: Optional[float]=...) -> Iterator[Future[_T]]
at: concurrent.futures.thread
ThreadPoolExecutor(max_workers: Optional[int]=..., thread_name_prefix: str=...)
at: concurrent.futures.thread.ThreadPoolExecutor
_counter = itertools.count().__next__
submit(fn: Callable[..., _T], /, *args: Any, **kwargs: Any) -> Future[_T]
at: os
system(command: AnyPath) -> int
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: app.Decryptor.Hash.hashBuster
- parser = argparse.ArgumentParser()
- parser.add_argument('-s', help='hash', dest='hash')
- parser.add_argument('-f', help='file containing hashes', dest='file')
- parser.add_argument('-d', help='directory containing hashes', dest='dir')
- parser.add_argument('-t', help='number of threads', dest='threads', type=int)
- args = parser.parse_args()
-
- #Colors and shit like that
- end = '\033[0m'
- red = '\033[91m'
- green = '\033[92m'
- white = '\033[97m'
- dgreen = '\033[32m'
- yellow = '\033[93m'
- back = '\033[7;91m'
- run = '\033[97m[~]\033[0m'
- que = '\033[94m[?]\033[0m'
- bad = '\033[91m[-]\033[0m'
- info = '\033[93m[!]\033[0m'
- good = '\033[92m[+]\033[0m'
-
- cwd = os.getcwd()
- directory = args.dir
- file = args.file
- thread_count = args.threads or 4
-
- if directory:
- if directory[-1] == '/':
- directory = directory[:-1]
+ thread_count = 4
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# Determine the most likely letters for each letter in the key:
ciphertextUp = ciphertext.upper()
# allFreqScores is a list of mostLikelyKeyLength number of lists.
# These inner lists are the freqScores lists.
allFreqScores = []
for nth in range(1, mostLikelyKeyLength + 1):
nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
# freqScores is a list of tuples like:
# [(<letter>, <Eng. Freq. match score>), ... ]
# List is sorted by match score. Higher score means better match.
# See the englishFreqMatchScore() comments in freqAnalysis.py.
freqScores = []
for possibleKey in self.LETTERS:
decryptedText = self.decryptMessage(possibleKey, nthLetters)
keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
freqScores.append(keyAndFreqMatchTuple)
# Sort by match score:
freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
if not self.SILENT_MODE:
for i in range(len(allFreqScores)):
# Use i + 1 so the first letter is not called the "0th" letter:
print('Possible letters for letter %s of the key: ' % (i + 1), end='')
for freqScore in allFreqScores[i]:
print('%s ' % freqScore[0], end='')
print() # Print a newline.
# Try every combination of the most likely letters for each position
# in the key:
</s>
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 1
<s> newline.
# Try every combination of the most likely letters for each position
# in the key:
for indexes in itertools.product(range(self.NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
# Create a possible key from the letters in allFreqScores:
possibleKey = ''
for i in range(mostLikelyKeyLength):
possibleKey += allFreqScores[i][indexes[i]][0]
if not self.SILENT_MODE:
print('Attempting with key: %s' % (possibleKey))
decryptedText = self.decryptMessage(possibleKey, ciphertextUp)
if self.lc.checkLanguage(decryptedText):
# Set the hacked ciphertext to the original casing:
origCase = []
for i in range(len(ciphertext)):
if ciphertext[i].isupper():
origCase.append(decryptedText[i].upper())
else:
origCase.append(decryptedText[i].lower())
decryptedText = ''.join(origCase)
# Check with user to see if the key has been found:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Viginere", "Extra Information": f"The key used is {possibleKey}"}
# No English-looking decryption found, so return None:
+ return None
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Pig Latin", "Extra Information": None}
|
app.Decryptor.basicEncryption.basic_parent/BasicParent.__init__ | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <7>:<add> self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
<del> self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
| # module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
<0> self.lc = lc
<1> self.caesar = Caesar(self.lc)
<2> self.reverse = Reverse(self.lc)
<3> self.viginere = Viginere(self.lc)
<4> self.pig = PigLatin(self.lc)
<5> self.trans = Transposition(self.lc)
<6>
<7> self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
<8>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.caesar
Caesar(lc)
at: Decryptor.basicEncryption.pigLatin
PigLatin(lc)
at: Decryptor.basicEncryption.reverse
Reverse(lc)
at: Decryptor.basicEncryption.transposition
Transposition(lc)
at: Decryptor.basicEncryption.viginere
Viginere(lc)
at: app.Decryptor.basicEncryption.basic_parent.BasicParent.decrypt
self.lc = self.lc + answer["lc"]
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 1===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 2===========
# module: app.Decryptor.Hash.hashBuster
- parser = argparse.ArgumentParser()
- parser.add_argument('-s', help='hash', dest='hash')
- parser.add_argument('-f', help='file containing hashes', dest='file')
- parser.add_argument('-d', help='directory containing hashes', dest='dir')
- parser.add_argument('-t', help='number of threads', dest='threads', type=int)
- args = parser.parse_args()
-
- #Colors and shit like that
- end = '\033[0m'
- red = '\033[91m'
- green = '\033[92m'
- white = '\033[97m'
- dgreen = '\033[32m'
- yellow = '\033[93m'
- back = '\033[7;91m'
- run = '\033[97m[~]\033[0m'
- que = '\033[94m[?]\033[0m'
- bad = '\033[91m[-]\033[0m'
- info = '\033[93m[!]\033[0m'
- good = '\033[92m[+]\033[0m'
-
- cwd = os.getcwd()
- directory = args.dir
- file = args.file
- thread_count = args.threads or 4
-
- if directory:
- if directory[-1] == '/':
- directory = directory[:-1]
+ thread_count = 4
===========changed ref 3===========
# module: app.Decryptor.Hash.hashBuster
def crack(hashvalue):
result = False
if len(hashvalue) == 32:
for api in md5:
r = api(hashvalue, 'md5')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "md5", "Extra Information": None}
elif len(hashvalue) == 40:
for api in sha1:
r = api(hashvalue, 'sha1')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha1", "Extra Information": None}
elif len(hashvalue) == 64:
for api in sha256:
r = api(hashvalue, 'sha256')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha256", "Extra Information": None}
elif len(hashvalue) == 96:
for api in sha384:
r = api(hashvalue, 'sha384')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha384", "Extra Information": None}
elif len(hashvalue) == 128:
for api in sha512:
r = api(hashvalue, 'sha512')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha512", "Extra Information": None}
else:
- if not file:
+ return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
- return {"lc": None, "IsPlaintext?": False, "Plaintext":</s>
===========changed ref 4===========
# module: app.Decryptor.Hash.hashBuster
def crack(hashvalue):
# offset: 1
<s> to manually crack the hash."}
- return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
- else:
- return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
|
app.Decryptor.basicEncryption.basic_parent/BasicParent.decrypt | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <14>:<add>
<add> # so viginere runs ages
<add> # and you cant kill threads in a pool
<add> # so i just run it last lol
<add> result = self.callDecrypt(self.viginere)
<add> if result["IsPlaintext?"]:
<add> return result
| # module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
<0> self.text = text
<1>
<2> from multiprocessing.dummy import Pool as ThreadPool
<3> pool = ThreadPool(4)
<4> answers = pool.map(self.callDecrypt, self.list_of_objects)
<5>
<6> """for item in self.list_of_objects:
<7> result = item.decrypt(text)
<8> answers.append(result)"""
<9> for answer in answers:
<10> # adds the LC objects together
<11> self.lc = self.lc + answer["lc"]
<12> if answer["IsPlaintext?"]:
<13> return answer
<14> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
<15>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.basic_parent.BasicParent
callDecrypt(obj)
at: app.Decryptor.basicEncryption.basic_parent.BasicParent.__init__
self.lc = lc
self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
at: multiprocessing.dummy
Pool(processes: Optional[int]=..., initializer: Optional[Callable[..., Any]]=..., initargs: Iterable[Any]=...) -> Any
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
self.trans = Transposition(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 2===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 3===========
# module: app.Decryptor.Hash.hashBuster
- parser = argparse.ArgumentParser()
- parser.add_argument('-s', help='hash', dest='hash')
- parser.add_argument('-f', help='file containing hashes', dest='file')
- parser.add_argument('-d', help='directory containing hashes', dest='dir')
- parser.add_argument('-t', help='number of threads', dest='threads', type=int)
- args = parser.parse_args()
-
- #Colors and shit like that
- end = '\033[0m'
- red = '\033[91m'
- green = '\033[92m'
- white = '\033[97m'
- dgreen = '\033[32m'
- yellow = '\033[93m'
- back = '\033[7;91m'
- run = '\033[97m[~]\033[0m'
- que = '\033[94m[?]\033[0m'
- bad = '\033[91m[-]\033[0m'
- info = '\033[93m[!]\033[0m'
- good = '\033[92m[+]\033[0m'
-
- cwd = os.getcwd()
- directory = args.dir
- file = args.file
- thread_count = args.threads or 4
-
- if directory:
- if directory[-1] == '/':
- directory = directory[:-1]
+ thread_count = 4
===========changed ref 4===========
# module: app.Decryptor.Hash.hashBuster
def crack(hashvalue):
result = False
if len(hashvalue) == 32:
for api in md5:
r = api(hashvalue, 'md5')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "md5", "Extra Information": None}
elif len(hashvalue) == 40:
for api in sha1:
r = api(hashvalue, 'sha1')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha1", "Extra Information": None}
elif len(hashvalue) == 64:
for api in sha256:
r = api(hashvalue, 'sha256')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha256", "Extra Information": None}
elif len(hashvalue) == 96:
for api in sha384:
r = api(hashvalue, 'sha384')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha384", "Extra Information": None}
elif len(hashvalue) == 128:
for api in sha512:
r = api(hashvalue, 'sha512')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha512", "Extra Information": None}
else:
- if not file:
+ return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
- return {"lc": None, "IsPlaintext?": False, "Plaintext":</s>
===========changed ref 5===========
# module: app.Decryptor.Hash.hashBuster
def crack(hashvalue):
# offset: 1
<s> to manually crack the hash."}
- return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
- else:
- return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
|
app.languageCheckerMod.dictionaryChecker/dictionaryChecker.__init__ | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <3>:<add> self.languageThreshold = 75
<del> self.languageThreshold = 35
| # module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
<0> self.mh = mathsHelper.mathsHelper()
<1> self.languagePercentage = 0.0
<2> self.languageWordsCounter = 0.0
<3> self.languageThreshold = 35
<4>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker.checkDictionary
self.languageWordsCounter = counter
self.languagePercentage = self.mh.percentage(float(self.languageWordsCounter), float(len(text)))
at: mathsHelper
mathsHelper()
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
self.trans = Transposition(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
===========changed ref 2===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
return answer
+
+ # so viginere runs ages
+ # and you cant kill threads in a pool
+ # so i just run it last lol
+ result = self.callDecrypt(self.viginere)
+ if result["IsPlaintext?"]:
+ return result
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
===========changed ref 4===========
# module: app.Decryptor.Hash.hashBuster
- parser = argparse.ArgumentParser()
- parser.add_argument('-s', help='hash', dest='hash')
- parser.add_argument('-f', help='file containing hashes', dest='file')
- parser.add_argument('-d', help='directory containing hashes', dest='dir')
- parser.add_argument('-t', help='number of threads', dest='threads', type=int)
- args = parser.parse_args()
-
- #Colors and shit like that
- end = '\033[0m'
- red = '\033[91m'
- green = '\033[92m'
- white = '\033[97m'
- dgreen = '\033[32m'
- yellow = '\033[93m'
- back = '\033[7;91m'
- run = '\033[97m[~]\033[0m'
- que = '\033[94m[?]\033[0m'
- bad = '\033[91m[-]\033[0m'
- info = '\033[93m[!]\033[0m'
- good = '\033[92m[+]\033[0m'
-
- cwd = os.getcwd()
- directory = args.dir
- file = args.file
- thread_count = args.threads or 4
-
- if directory:
- if directory[-1] == '/':
- directory = directory[:-1]
+ thread_count = 4
===========changed ref 5===========
# module: app.Decryptor.Hash.hashBuster
def crack(hashvalue):
result = False
if len(hashvalue) == 32:
for api in md5:
r = api(hashvalue, 'md5')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "md5", "Extra Information": None}
elif len(hashvalue) == 40:
for api in sha1:
r = api(hashvalue, 'sha1')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha1", "Extra Information": None}
elif len(hashvalue) == 64:
for api in sha256:
r = api(hashvalue, 'sha256')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha256", "Extra Information": None}
elif len(hashvalue) == 96:
for api in sha384:
r = api(hashvalue, 'sha384')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha384", "Extra Information": None}
elif len(hashvalue) == 128:
for api in sha512:
r = api(hashvalue, 'sha512')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha512", "Extra Information": None}
else:
- if not file:
+ return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
- return {"lc": None, "IsPlaintext?": False, "Plaintext":</s> |
app.Decryptor.Encoding.morsecode/MorseCode.__init__ | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <1>:<add> self.ALLOWED = [".", "-", " ", "/", "\n"]
<del> self.ALLOWED = [".", "-", " ", "/"]
<15>:<add> '9': '----.', " ": "\n"
<del> '9': '----.'
| # module: app.Decryptor.Encoding.morsecode
class MorseCode:
def __init__(self, lc):
<0> self.lc = lc
<1> self.ALLOWED = [".", "-", " ", "/"]
<2> self.MORSE_CODE_DICT = {'A': '.-', 'B': '-...',
<3> 'C': '-.-.', 'D': '-..', 'E': '.',
<4> 'F': '..-.', 'G': '--.', 'H': '....',
<5> 'I': '..', 'J': '.---', 'K': '-.-',
<6> 'L': '.-..', 'M': '--', 'N': '-.',
<7> 'O': '---', 'P': '.--.', 'Q': '--.-',
<8> 'R': '.-.', 'S': '...', 'T': '-',
<9> 'U': '..-', 'V': '...-', 'W': '.--',
<10> 'X': '-..-', 'Y': '-.--', 'Z': '--..',
<11> '?': '..--..', '.': '.-.-.-', ' ': '/',
<12> '0': '-----', '1': '.----', '2': '..---',
<13> '3': '...--', '4': '....-', '5': '.....',
<14> '6': '-....', '7': '--...', '8': '---..',
<15> '9': '----.'
<16> }
<17>
<18> self.MORSE_CODE_DICT_INV = {v: k for k, v in self.MORSE_CODE_DICT.items()}
<19>
| ===========changed ref 0===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 75
- self.languageThreshold = 35
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
self.trans = Transposition(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
===========changed ref 3===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
return answer
+
+ # so viginere runs ages
+ # and you cant kill threads in a pool
+ # so i just run it last lol
+ result = self.callDecrypt(self.viginere)
+ if result["IsPlaintext?"]:
+ return result
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
===========changed ref 5===========
# module: app.Decryptor.Hash.hashBuster
- parser = argparse.ArgumentParser()
- parser.add_argument('-s', help='hash', dest='hash')
- parser.add_argument('-f', help='file containing hashes', dest='file')
- parser.add_argument('-d', help='directory containing hashes', dest='dir')
- parser.add_argument('-t', help='number of threads', dest='threads', type=int)
- args = parser.parse_args()
-
- #Colors and shit like that
- end = '\033[0m'
- red = '\033[91m'
- green = '\033[92m'
- white = '\033[97m'
- dgreen = '\033[32m'
- yellow = '\033[93m'
- back = '\033[7;91m'
- run = '\033[97m[~]\033[0m'
- que = '\033[94m[?]\033[0m'
- bad = '\033[91m[-]\033[0m'
- info = '\033[93m[!]\033[0m'
- good = '\033[92m[+]\033[0m'
-
- cwd = os.getcwd()
- directory = args.dir
- file = args.file
- thread_count = args.threads or 4
-
- if directory:
- if directory[-1] == '/':
- directory = directory[:-1]
+ thread_count = 4
===========changed ref 6===========
# module: app.Decryptor.Hash.hashBuster
def crack(hashvalue):
result = False
if len(hashvalue) == 32:
for api in md5:
r = api(hashvalue, 'md5')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "md5", "Extra Information": None}
elif len(hashvalue) == 40:
for api in sha1:
r = api(hashvalue, 'sha1')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha1", "Extra Information": None}
elif len(hashvalue) == 64:
for api in sha256:
r = api(hashvalue, 'sha256')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha256", "Extra Information": None}
elif len(hashvalue) == 96:
for api in sha384:
r = api(hashvalue, 'sha384')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha384", "Extra Information": None}
elif len(hashvalue) == 128:
for api in sha512:
r = api(hashvalue, 'sha512')
if r:
return {"lc": None, "IsPlaintext?": True, "Plaintext": r, "Cipher": "sha512", "Extra Information": None}
else:
- if not file:
+ return {"lc": None, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": "The hash wasn't found. Please try Hashkiller.co.uk first, then use Hashcat to manually crack the hash."}
- return {"lc": None, "IsPlaintext?": False, "Plaintext":</s> |
app.Decryptor.basicEncryption.transposition/Transposition.decrypt | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <1>:<add> print(len(text))
<3>:<add> print(decryptedText)
<4>:<add> print("this is english according to lc")
<5>:<add> print("finished transposition")
<6>:<add> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
<del> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
| # module: app.Decryptor.basicEncryption.transposition
class Transposition:
def decrypt(self, text):
<0> # Brute-force by looping through every possible key.
<1> for key in range(1, len(text)):
<2> decryptedText = self.decryptMessage(key, text)
<3> if self.lc.checkLanguage(decryptedText):
<4> return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
<5>
<6> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
<7>
| ===========changed ref 0===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
+ def main(self):
+ myMessage = """AaKoosoeDe5 b5sn ma reno ora'lhlrrceey e enlh
+ na indeit n uhoretrm au ieu v er Ne2 gmanw,forwnlbsya apor tE.no
+ euarisfatt e mealefedhsppmgAnlnoe(c -or)alat r lw o eb nglom,Ain
+ one dtes ilhetcdba. t tg eturmudg,tfl1e1 v nitiaicynhrCsaemie-sp
+ ncgHt nie cetrgmnoa yc r,ieaa toesa- e a0m82e1w shcnth ekh
+ gaecnpeutaaieetgn iodhso d ro hAe snrsfcegrt NCsLc b17m8aEheideikfr
+ aBercaeu thllnrshicwsg etriebruaisss d iorr."""
+
+ hackedMessage = self.hackTransposition(myMessage)
+
+ if hackedMessage == None:
+ print('Failed to hack encryption...')
+ else:
+ print('Copying hacked message to clipboard...')
+ print(hackedMessage)
+
===========changed ref 1===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 75
- self.languageThreshold = 35
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
self.trans = Transposition(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
===========changed ref 4===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
return answer
+
+ # so viginere runs ages
+ # and you cant kill threads in a pool
+ # so i just run it last lol
+ result = self.callDecrypt(self.viginere)
+ if result["IsPlaintext?"]:
+ return result
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
===========changed ref 6===========
# module: app.Decryptor.Hash.hashBuster
- parser = argparse.ArgumentParser()
- parser.add_argument('-s', help='hash', dest='hash')
- parser.add_argument('-f', help='file containing hashes', dest='file')
- parser.add_argument('-d', help='directory containing hashes', dest='dir')
- parser.add_argument('-t', help='number of threads', dest='threads', type=int)
- args = parser.parse_args()
-
- #Colors and shit like that
- end = '\033[0m'
- red = '\033[91m'
- green = '\033[92m'
- white = '\033[97m'
- dgreen = '\033[32m'
- yellow = '\033[93m'
- back = '\033[7;91m'
- run = '\033[97m[~]\033[0m'
- que = '\033[94m[?]\033[0m'
- bad = '\033[91m[-]\033[0m'
- info = '\033[93m[!]\033[0m'
- good = '\033[92m[+]\033[0m'
-
- cwd = os.getcwd()
- directory = args.dir
- file = args.file
- thread_count = args.threads or 4
-
- if directory:
- if directory[-1] == '/':
- directory = directory[:-1]
+ thread_count = 4
|
app.Decryptor.basicEncryption.transposition/Transposition.decryptMessage | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <0>:<add> # Simulate columns and rows of the grid the plaintext was written on
<add> numColumns = int(math.ceil(len(message) / float(key)))
<add> numRows = key
<add> numShadedBoxes = (numColumns * numRows) - len(message)
<del> # The transposition decrypt function will simulate the "columns" and
<1>:<del> # "rows" of the grid that the plaintext is written on by using a list
<2>:<del> # of strings. First, we need to calculate a few values.
<4>:<del> # The number of "columns" in our transposition grid:
<5>:<del> numOfColumns = int(math.ceil(len(message) / float(key)))
<6>:<del> # The number of "rows" in our grid will need:
<7>:<del> numOfRows = key
<8>:<del> # The number of "shaded boxes" in the last "column" of the grid:
<9>:<del> numOfShadedBoxes = (numOfColumns * numOfRows) - len(message)
<10>:<add> # Each string in plaintext reprsents a column in the grid
<add> plaintext = [''] * numColumns
<11>:<del> # Each string in plaintext represents a column in the grid.
<12>:<del> plaintext = [''] * numOfColumns
<13>:<del>
<14>:<add> # The column and row variables point to the grid location of the next char
<del> # The column and row variables point to where in the grid the next
<15>:<add> # in the encrypted message
<del> # character in the encrypted message will go.
<19>:<add> for character in message:
<del> for symbol in message:
<20>:<add> plaintext[column] += character
<del> plaintext[column] += symbol
<21>:<add> column += 1
<del> column += 1 # Point to next column.
<23>:<del> # If there are no more columns OR we're at a shaded box, go back to
<24>:<del> # the first column and the next row:
<25>:<add> # If no more columns or empty bos, move to first column of next row
<add> if(column == numColumns) or (column == numColumns - 1 and row >= numRows - numShadedBoxes):
<del> if (column == numOfColumns) or (column == numOfColumns - 1 and row >= numOfRows - numOfShadedBoxes):
<29>:<add> return''.join(plaintext)
| # module: app.Decryptor.basicEncryption.transposition
class Transposition:
def decryptMessage(self, key, message):
<0> # The transposition decrypt function will simulate the "columns" and
<1> # "rows" of the grid that the plaintext is written on by using a list
<2> # of strings. First, we need to calculate a few values.
<3>
<4> # The number of "columns" in our transposition grid:
<5> numOfColumns = int(math.ceil(len(message) / float(key)))
<6> # The number of "rows" in our grid will need:
<7> numOfRows = key
<8> # The number of "shaded boxes" in the last "column" of the grid:
<9> numOfShadedBoxes = (numOfColumns * numOfRows) - len(message)
<10>
<11> # Each string in plaintext represents a column in the grid.
<12> plaintext = [''] * numOfColumns
<13>
<14> # The column and row variables point to where in the grid the next
<15> # character in the encrypted message will go.
<16> column = 0
<17> row = 0
<18>
<19> for symbol in message:
<20> plaintext[column] += symbol
<21> column += 1 # Point to next column.
<22>
<23> # If there are no more columns OR we're at a shaded box, go back to
<24> # the first column and the next row:
<25> if (column == numOfColumns) or (column == numOfColumns - 1 and row >= numOfRows - numOfShadedBoxes):
<26> column = 0
<27> row += 1
<28>
<29> return ''.join(plaintext)
<30>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.transposition.Transposition
decryptMessage(key, message)
at: app.Decryptor.basicEncryption.transposition.Transposition.__init__
self.lc = lc
at: app.Decryptor.basicEncryption.transposition.Transposition.main
hackedMessage = self.hackTransposition(myMessage)
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def decrypt(self, text):
# Brute-force by looping through every possible key.
+ print(len(text))
for key in range(1, len(text)):
decryptedText = self.decryptMessage(key, text)
+ print(decryptedText)
if self.lc.checkLanguage(decryptedText):
+ print("this is english according to lc")
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
+ print("finished transposition")
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
+ def main(self):
+ myMessage = """AaKoosoeDe5 b5sn ma reno ora'lhlrrceey e enlh
+ na indeit n uhoretrm au ieu v er Ne2 gmanw,forwnlbsya apor tE.no
+ euarisfatt e mealefedhsppmgAnlnoe(c -or)alat r lw o eb nglom,Ain
+ one dtes ilhetcdba. t tg eturmudg,tfl1e1 v nitiaicynhrCsaemie-sp
+ ncgHt nie cetrgmnoa yc r,ieaa toesa- e a0m82e1w shcnth ekh
+ gaecnpeutaaieetgn iodhso d ro hAe snrsfcegrt NCsLc b17m8aEheideikfr
+ aBercaeu thllnrshicwsg etriebruaisss d iorr."""
+
+ hackedMessage = self.hackTransposition(myMessage)
+
+ if hackedMessage == None:
+ print('Failed to hack encryption...')
+ else:
+ print('Copying hacked message to clipboard...')
+ print(hackedMessage)
+
===========changed ref 2===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 75
- self.languageThreshold = 35
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
self.trans = Transposition(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
===========changed ref 5===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
return answer
+
+ # so viginere runs ages
+ # and you cant kill threads in a pool
+ # so i just run it last lol
+ result = self.callDecrypt(self.viginere)
+ if result["IsPlaintext?"]:
+ return result
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
|
app.main/Ciphey.__init__ | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <12>:<add>
<add> self.level = level
<add> self.sickomode = sickomode
| # module: app.main
class Ciphey:
+ def __init__(self, text, level=1, sickomode=False):
- def __init__(self, text):
<0> # general purpose modules
<1> self.ai = NeuralNetwork()
<2> self.lc = LanguageChecker()
<3> self.mh = mathsHelper.mathsHelper()
<4>
<5> # the one bit of text given to us to decrypt
<6> self.text = text
<7>
<8> # the decryptor components
<9> self.basic = BasicParent(self.lc)
<10> self.hash = HashParent()
<11> self.encoding = EncodingParent(self.lc)
<12>
| ===========unchanged ref 0===========
at: Decryptor.Encoding.encodingParent
EncodingParent(lc)
at: Decryptor.Hash.hashParent
HashParent()
at: Decryptor.basicEncryption.basic_parent
BasicParent(lc)
at: mathsHelper
mathsHelper()
at: neuralNetworkMod.nn
NeuralNetwork()
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.transposition
+
+ if __name__ == '__main__':
+ t = Transposition("a")
+ t.main()
-
===========changed ref 1===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 75
- self.languageThreshold = 35
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
self.trans = Transposition(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
+ def hackTransposition(self, message):
+ print('Attempting to hack message...')
+ print('Press CTRL-C on Windows or CTRL-D on macOS or Linux to cancel....')
+
+ # Loop over every key
+ for key in range(1, len(message)):
+ print('Attempting key #%s' % (key))
+ if key >= 10:
+ return None
+
+ decryptedText = self.decryptMessage(key, message)
+ print('Key %s: %s' % (key, decryptedText[:100]))
+ #if self.lc.checkLanguage(message):
+ # Ask if this is correct decryption!!!
+
+ # If hack failed
+ return None
+
===========changed ref 5===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def decrypt(self, text):
# Brute-force by looping through every possible key.
+ print(len(text))
for key in range(1, len(text)):
decryptedText = self.decryptMessage(key, text)
+ print(decryptedText)
if self.lc.checkLanguage(decryptedText):
+ print("this is english according to lc")
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
+ print("finished transposition")
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
===========changed ref 7===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
return answer
+
+ # so viginere runs ages
+ # and you cant kill threads in a pool
+ # so i just run it last lol
+ result = self.callDecrypt(self.viginere)
+ if result["IsPlaintext?"]:
+ return result
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
===========changed ref 8===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
+ def main(self):
+ myMessage = """AaKoosoeDe5 b5sn ma reno ora'lhlrrceey e enlh
+ na indeit n uhoretrm au ieu v er Ne2 gmanw,forwnlbsya apor tE.no
+ euarisfatt e mealefedhsppmgAnlnoe(c -or)alat r lw o eb nglom,Ain
+ one dtes ilhetcdba. t tg eturmudg,tfl1e1 v nitiaicynhrCsaemie-sp
+ ncgHt nie cetrgmnoa yc r,ieaa toesa- e a0m82e1w shcnth ekh
+ gaecnpeutaaieetgn iodhso d ro hAe snrsfcegrt NCsLc b17m8aEheideikfr
+ aBercaeu thllnrshicwsg etriebruaisss d iorr."""
+
+ hackedMessage = self.hackTransposition(myMessage)
+
+ if hackedMessage == None:
+ print('Failed to hack encryption...')
+ else:
+ print('Copying hacked message to clipboard...')
+ print(hackedMessage)
+ |
app.main/Ciphey.one_level_of_decryption | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <6>:<add> print(ret['Plaintext'])
<del> print(ret)
<7>:<add> return ret
| # module: app.main
class Ciphey:
+ def one_level_of_decryption(self, file=None, sickomode=None):
- def one_level_of_decryption(self):
<0> for key, val in self.whatToChoose.items():
<1> # https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string
<2> if not isinstance(key, str):
<3> key.setProbTable(val)
<4> ret = key.decrypt(self.text)
<5> if ret['IsPlaintext?']:
<6> print(ret)
<7> print("No encryption found. Here's the probabilities we calculated")
<8> import pprint
<9> pprint.pprint(self.whatToChoose)
<10>
| ===========unchanged ref 0===========
at: Decryptor.Encoding.encodingParent.EncodingParent
setProbTable(table)
decrypt(text)
at: Decryptor.Hash.hashParent.HashParent
decrypt(text)
setProbTable(val)
at: Decryptor.basicEncryption.basic_parent.BasicParent
decrypt(text)
setProbTable(prob)
at: app.main.Ciphey.__init__
self.text = text
at: app.main.Ciphey.decrypt
self.whatToChoose = new_dict
self.whatToChoose = {self.hash:
{
"sha1": self.probabilityDistribution[0],
"md5": self.probabilityDistribution[1],
"sha256": self.probabilityDistribution[2],
"sha512": self.probabilityDistribution[3]
},
self.basic: {
"caesar": self.probabilityDistribution[4]
},
self.encoding:{
"plaintext": self.probabilityDistribution[5]
}
}
at: collections.OrderedDict
items() -> _OrderedDictItemsView[_KT, _VT]
at: pprint
pprint(object: object, stream: Optional[IO[str]]=..., indent: int=..., width: int=..., depth: Optional[int]=..., *, compact: bool=...) -> None
===========changed ref 0===========
# module: app.main
class Ciphey:
+ def __init__(self, text, level=1, sickomode=False):
- def __init__(self, text):
# general purpose modules
self.ai = NeuralNetwork()
self.lc = LanguageChecker()
self.mh = mathsHelper.mathsHelper()
# the one bit of text given to us to decrypt
self.text = text
# the decryptor components
self.basic = BasicParent(self.lc)
self.hash = HashParent()
self.encoding = EncodingParent(self.lc)
+
+ self.level = level
+ self.sickomode = sickomode
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.transposition
+
+ if __name__ == '__main__':
+ t = Transposition("a")
+ t.main()
-
===========changed ref 2===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 75
- self.languageThreshold = 35
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
self.trans = Transposition(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
+ def hackTransposition(self, message):
+ print('Attempting to hack message...')
+ print('Press CTRL-C on Windows or CTRL-D on macOS or Linux to cancel....')
+
+ # Loop over every key
+ for key in range(1, len(message)):
+ print('Attempting key #%s' % (key))
+ if key >= 10:
+ return None
+
+ decryptedText = self.decryptMessage(key, message)
+ print('Key %s: %s' % (key, decryptedText[:100]))
+ #if self.lc.checkLanguage(message):
+ # Ask if this is correct decryption!!!
+
+ # If hack failed
+ return None
+
===========changed ref 6===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 7===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def decrypt(self, text):
# Brute-force by looping through every possible key.
+ print(len(text))
for key in range(1, len(text)):
decryptedText = self.decryptMessage(key, text)
+ print(decryptedText)
if self.lc.checkLanguage(decryptedText):
+ print("this is english according to lc")
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
+ print("finished transposition")
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
|
app.Decryptor.Hash.hashParent/HashParent.decrypt | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <0>:<add> result = hashBuster.crack(text)
<del> return hashBuster.crack(text)
<1>:<add> return result
| # module: app.Decryptor.Hash.hashParent
class HashParent:
def decrypt(self, text):
<0> return hashBuster.crack(text)
<1>
| ===========unchanged ref 0===========
at: Decryptor.Hash.hashBuster
crack(hashvalue)
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.transposition
+
+ if __name__ == '__main__':
+ t = Transposition("a")
+ t.main()
-
===========changed ref 1===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 75
- self.languageThreshold = 35
===========changed ref 2===========
# module: app.main
class Ciphey:
+ def __init__(self, text, level=1, sickomode=False):
- def __init__(self, text):
# general purpose modules
self.ai = NeuralNetwork()
self.lc = LanguageChecker()
self.mh = mathsHelper.mathsHelper()
# the one bit of text given to us to decrypt
self.text = text
# the decryptor components
self.basic = BasicParent(self.lc)
self.hash = HashParent()
self.encoding = EncodingParent(self.lc)
+
+ self.level = level
+ self.sickomode = sickomode
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 4===========
# module: app.main
class Ciphey:
+ def one_level_of_decryption(self, file=None, sickomode=None):
- def one_level_of_decryption(self):
for key, val in self.whatToChoose.items():
# https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string
if not isinstance(key, str):
key.setProbTable(val)
ret = key.decrypt(self.text)
if ret['IsPlaintext?']:
+ print(ret['Plaintext'])
- print(ret)
+ return ret
print("No encryption found. Here's the probabilities we calculated")
import pprint
pprint.pprint(self.whatToChoose)
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
self.trans = Transposition(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
+ def hackTransposition(self, message):
+ print('Attempting to hack message...')
+ print('Press CTRL-C on Windows or CTRL-D on macOS or Linux to cancel....')
+
+ # Loop over every key
+ for key in range(1, len(message)):
+ print('Attempting key #%s' % (key))
+ if key >= 10:
+ return None
+
+ decryptedText = self.decryptMessage(key, message)
+ print('Key %s: %s' % (key, decryptedText[:100]))
+ #if self.lc.checkLanguage(message):
+ # Ask if this is correct decryption!!!
+
+ # If hack failed
+ return None
+
===========changed ref 7===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 8===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def decrypt(self, text):
# Brute-force by looping through every possible key.
+ print(len(text))
for key in range(1, len(text)):
decryptedText = self.decryptMessage(key, text)
+ print(decryptedText)
if self.lc.checkLanguage(decryptedText):
+ print("this is english according to lc")
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
+ print("finished transposition")
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
===========changed ref 9===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
return answer
+
+ # so viginere runs ages
+ # and you cant kill threads in a pool
+ # so i just run it last lol
+ result = self.callDecrypt(self.viginere)
+ if result["IsPlaintext?"]:
+ return result
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
|
app.Decryptor.Encoding.binary/Binary.decrypt | Modified | Ciphey~Ciphey | 516a7261bc965471c893ed0312a62be8066b9633 | updated neural network and updated transposition cipher | <9>:<add> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
| # module: app.Decryptor.Encoding.binary
class Binary:
def decrypt(self, text):
<0> try:
<1> result = self.decode(text)
<2> except ValueError as e:
<3> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
<4> except TypeError as e:
<5> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
<6>
<7> if self.lc.checkLanguage(result):
<8> return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": result, "Cipher": "Ascii to Binary encoded", "Extra Information": None}
<9>
| ===========unchanged ref 0===========
at: app.Decryptor.Encoding.binary.Binary
decode(text)
at: app.Decryptor.Encoding.binary.Binary.__init__
self.lc = lc
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.transposition
+
+ if __name__ == '__main__':
+ t = Transposition("a")
+ t.main()
-
===========changed ref 1===========
# module: app.Decryptor.Hash.hashParent
class HashParent:
def decrypt(self, text):
+ result = hashBuster.crack(text)
- return hashBuster.crack(text)
+ return result
===========changed ref 2===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 75
- self.languageThreshold = 35
===========changed ref 3===========
# module: app.main
class Ciphey:
+ def __init__(self, text, level=1, sickomode=False):
- def __init__(self, text):
# general purpose modules
self.ai = NeuralNetwork()
self.lc = LanguageChecker()
self.mh = mathsHelper.mathsHelper()
# the one bit of text given to us to decrypt
self.text = text
# the decryptor components
self.basic = BasicParent(self.lc)
self.hash = HashParent()
self.encoding = EncodingParent(self.lc)
+
+ self.level = level
+ self.sickomode = sickomode
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def __init__(self, lc):
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
+ self.MAX_KEY_LENGTH = 16 # Will not attempt keys longer than this.
- self.MAX_KEY_LENGTH = 4 # Will not attempt keys longer than this.
self.NONLETTERS_PATTERN = re.compile('[^A-Z]')
self.lc = lc
===========changed ref 5===========
# module: app.main
class Ciphey:
+ def one_level_of_decryption(self, file=None, sickomode=None):
- def one_level_of_decryption(self):
for key, val in self.whatToChoose.items():
# https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string
if not isinstance(key, str):
key.setProbTable(val)
ret = key.decrypt(self.text)
if ret['IsPlaintext?']:
+ print(ret['Plaintext'])
- print(ret)
+ return ret
print("No encryption found. Here's the probabilities we calculated")
import pprint
pprint.pprint(self.whatToChoose)
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
self.lc = lc
self.caesar = Caesar(self.lc)
self.reverse = Reverse(self.lc)
self.viginere = Viginere(self.lc)
self.pig = PigLatin(self.lc)
self.trans = Transposition(self.lc)
+ self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
- self.list_of_objects = [self.caesar, self.reverse, self.viginere, self.pig, self.trans]
===========changed ref 7===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
+ def hackTransposition(self, message):
+ print('Attempting to hack message...')
+ print('Press CTRL-C on Windows or CTRL-D on macOS or Linux to cancel....')
+
+ # Loop over every key
+ for key in range(1, len(message)):
+ print('Attempting key #%s' % (key))
+ if key >= 10:
+ return None
+
+ decryptedText = self.decryptMessage(key, message)
+ print('Key %s: %s' % (key, decryptedText[:100]))
+ #if self.lc.checkLanguage(message):
+ # Ask if this is correct decryption!!!
+
+ # If hack failed
+ return None
+
===========changed ref 8===========
# module: app.Decryptor.Hash.hashBuster
-
- if directory:
- try:
- grepper(directory)
- except KeyboardInterrupt:
- pass
-
- elif file:
- try:
- miner(file)
- except KeyboardInterrupt:
- pass
- with open('cracked-%s' % file.split('/')[-1], 'w+') as f:
- for hashvalue, cracked in result.items():
- f.write(hashvalue + ':' + cracked + '\n')
- print ('%s Results saved in cracked-%s' % (info, file.split('/')[-1]))
-
- elif args.hash:
- single(args)
-
===========changed ref 9===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def decrypt(self, text):
# Brute-force by looping through every possible key.
+ print(len(text))
for key in range(1, len(text)):
decryptedText = self.decryptMessage(key, text)
+ print(decryptedText)
if self.lc.checkLanguage(decryptedText):
+ print("this is english according to lc")
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
+ print("finished transposition")
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
===========changed ref 10===========
# module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def decrypt(self, text):
self.text = text
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
return answer
+
+ # so viginere runs ages
+ # and you cant kill threads in a pool
+ # so i just run it last lol
+ result = self.callDecrypt(self.viginere)
+ if result["IsPlaintext?"]:
+ return result
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
|
app.languageCheckerMod.dictionaryChecker/dictionaryChecker.__init__ | Modified | Ciphey~Ciphey | 1f5a9080fdd4b4de2bdc722ce5ce7af0cc36a699 | goodbye! | <3>:<add> self.languageThreshold = 55
<del> self.languageThreshold = 75
| # module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
<0> self.mh = mathsHelper.mathsHelper()
<1> self.languagePercentage = 0.0
<2> self.languageWordsCounter = 0.0
<3> self.languageThreshold = 75
<4>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker.checkDictionary
self.languageWordsCounter = counter
self.languagePercentage = self.mh.percentage(float(self.languageWordsCounter), float(len(text)))
at: mathsHelper
mathsHelper()
|
app.Decryptor.basicEncryption.transposition/Transposition.main | Modified | Ciphey~Ciphey | 1f5a9080fdd4b4de2bdc722ce5ce7af0cc36a699 | goodbye! | <0>:<add> myMessage = """Cb b rssti aieih rooaopbrtnsceee er es no npfgcwu plri
<add>
<add> ch nitaalr eiuengiteehb(e1 hilincegeoamn fubehgtarndcstudmd nM eu eacBoltaetee
<add>
<add> oinebcdkyremdteghn.aa2r81a condari fmps" tad l t oisn sit u1rnd stara nvhn fs
<add>
<add> edbh ee,n e necrg6 8nmisv l nc muiftegiitm tutmg cm shSs9fcie ebintcaets h a
<add>
<add> ihda cctrhe ele 1O7 aaoem waoaatdahretnhechaopnooeapece9etfncdbgsoeb uuteitgna.
<add>
<add> rteoh add e,D7c1Etnpneehtn beete | # module: app.Decryptor.basicEncryption.transposition
class Transposition:
def main(self):
<0> myMessage = """AaKoosoeDe5 b5sn ma reno ora'lhlrrceey e enlh
<1> na indeit n uhoretrm au ieu v er Ne2 gmanw,forwnlbsya apor tE.no
<2> euarisfatt e mealefedhsppmgAnlnoe(c -or)alat r lw o eb nglom,Ain
<3> one dtes ilhetcdba. t tg eturmudg,tfl1e1 v nitiaicynhrCsaemie-sp
<4> ncgHt nie cetrgmnoa yc r,ieaa toesa- e a0m82e1w shcnth ekh
<5> gaecnpeutaaieetgn iodhso d ro hAe snrsfcegrt NCsLc b17m8aEheideikfr
<6> aBercaeu thllnrshicwsg etriebruaisss d iorr."""
<7>
<8> hackedMessage = self.hackTransposition(myMessage)
<9>
<10> if hackedMessage == None:
<11> print('Failed to hack encryption...')
<12> else:
<13> print('Copying hacked message to clipboard...')
<14> print(hackedMessage)
<15>
| ===========changed ref 0===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 55
- self.languageThreshold = 75
===========changed ref 1===========
# module: app.main
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Automated decryption tool. Put in the encrypted text and Ciphey will decrypt it.')
parser.add_argument('-f','--file', help='File you want to decrypt', required=False)
parser.add_argument('-l','--level', help='How many levels of decryption you want (the more levels, the slower it is)', required=False)
parser.add_argument('-g','--greppable', help='Are you grepping this output?', required=False)
+ parser.add_argument('-t','--text', help='Text to decrypt', required=False)
- parser.add_argument('-t','--text', help='Text to decrypt', required=True)
parser.add_argument('-s','--sicko-mode', help='If it is encrypted Ciphey WILL find it', required=False)
args = vars(parser.parse_args())
"""
██████╗██╗██████╗ ██╗ ██╗███████╗██╗ ██╗
██╔════╝██║██╔══██╗██║ ██║██╔════╝╚██╗ ██╔╝
�</s>
===========changed ref 2===========
# module: app.main
# offset: 1
<s>╚██╗ ██╔╝
██║ ██║██████╔╝███████║█████╗ ╚████╔╝
██║ ██║██╔═══╝ ██╔══██║██╔══╝ ╚██╔╝
╚██████╗██║██║ ██║ ██║███████╗ ██║
Made by Brandon Skerritt"""
#uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg
if args['text']:
+ #cipherObj = Ciphey(args['text'])
- cipherObj = Ciphey(args['text'])
+ cipherObj = Ciphey(""""AaKoosoeDe</s>
===========changed ref 3===========
# module: app.main
# offset: 2
<s>5sn ma reno ora'lhlrrceey e enlh
+ na indeit n uhoretrm au ieu v er Ne2 gmanw,forwnlbsya apor tE.no
+ euarisfatt e mealefedhsppmgAnlnoe(c -or)alat r lw o eb nglom,Ain
+ one dtes ilhetcdba. t tg eturmudg,tfl1e1 v nitiaicynhrCsaemie-sp
+ ncgHt nie cetrgmnoa yc r,ieaa toesa- e a0m82e1w shcnth ekh
+ gaecnpeutaaieetgn iodhso d ro hAe snrsfcegrt NCsLc b17m8aEheideikfr
+ aBercaeu thllnrshicwsg etriebruaisss d iorr.""")
cipherObj.decrypt()
else:
print("You didn't supply any arguments")
|
app.Decryptor.basicEncryption.transposition/Transposition.decrypt | Modified | Ciphey~Ciphey | 1f5a9080fdd4b4de2bdc722ce5ce7af0cc36a699 | goodbye! | <1>:<del> print(len(text))
<2>:<del> for key in range(1, len(text)):
<3>:<del> decryptedText = self.decryptMessage(key, text)
<4>:<del> print(decryptedText)
<5>:<del> if self.lc.checkLanguage(decryptedText):
<6>:<del> print("this is english according to lc")
<7>:<del> return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
<8>:<del> print("finished transposition")
<9>:<del>
<10>:<del> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
<11>:<add> decryptedText = self.hackTransposition("""ehlol ym aftehrh ellom ym ohteXrX""")
| # module: app.Decryptor.basicEncryption.transposition
class Transposition:
+
def decrypt(self, text):
<0> # Brute-force by looping through every possible key.
<1> print(len(text))
<2> for key in range(1, len(text)):
<3> decryptedText = self.decryptMessage(key, text)
<4> print(decryptedText)
<5> if self.lc.checkLanguage(decryptedText):
<6> print("this is english according to lc")
<7> return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
<8> print("finished transposition")
<9>
<10> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
<11>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.transposition.Transposition
hackTransposition(message)
at: app.Decryptor.basicEncryption.transposition.Transposition.main
myMessage = """Cb b rssti aieih rooaopbrtnsceee er es no npfgcwu plri
ch nitaalr eiuengiteehb(e1 hilincegeoamn fubehgtarndcstudmd nM eu eacBoltaetee
oinebcdkyremdteghn.aa2r81a condari fmps" tad l t oisn sit u1rnd stara nvhn fs
edbh ee,n e necrg6 8nmisv l nc muiftegiitm tutmg cm shSs9fcie ebintcaets h a
ihda cctrhe ele 1O7 aaoem waoaatdahretnhechaopnooeapece9etfncdbgsoeb uuteitgna.
rteoh add e,D7c1Etnpneehtn beete" evecoal lsfmcrl iu1cifgo ai. sl1rchdnheev sh
meBd ies e9t)nh,htcnoecplrrh ,ide hmtlme. pheaLem,toeinfgn t e9yce da' eN eMp a
ffn Fc1o ge eohg dere.eec s nfap yox hla yon. lnrnsreaBoa t,e eitsw il ulpbdofg
BRe bwlmprraio po droB wtinue r Pieno nc ayieeto'lulcih sfnc ownaSserbereiaSm
-eaiah, nnrttgcC maciiritvledastinideI nn rms iehn tsigaBmuoetcetias rn"""
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def main(self):
+ myMessage = """Cb b rssti aieih rooaopbrtnsceee er es no npfgcwu plri
+
+ ch nitaalr eiuengiteehb(e1 hilincegeoamn fubehgtarndcstudmd nM eu eacBoltaetee
+
+ oinebcdkyremdteghn.aa2r81a condari fmps" tad l t oisn sit u1rnd stara nvhn fs
+
+ edbh ee,n e necrg6 8nmisv l nc muiftegiitm tutmg cm shSs9fcie ebintcaets h a
+
+ ihda cctrhe ele 1O7 aaoem waoaatdahretnhechaopnooeapece9etfncdbgsoeb uuteitgna.
+
+ rteoh add e,D7c1Etnpneehtn beete" evecoal lsfmcrl iu1cifgo ai. sl1rchdnheev sh
+
+ meBd ies e9t)nh,htcnoecplrrh ,ide hmtlme. pheaLem,toeinfgn t e9yce da' eN eMp a
+
+ ffn Fc1o ge eohg dere.eec s nfap yox hla yon. lnrnsreaBoa t,e eitsw il ulpbdofg
+
+ BRe bwlmprraio po droB wtinue r Pieno nc ayieeto'lulcih sfnc ownaSserbereiaSm
+
+ -eaiah, nnrttgcC maciiritvledastinideI nn rms iehn tsigaBmuoetcetias rn"""
- myMessage</s>
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def main(self):
# offset: 1
<s>iritvledastinideI nn rms iehn tsigaBmuoetcetias rn"""
- myMessage = """AaKoosoeDe5 b5sn ma reno ora'lhlrrceey e enlh
- na indeit n uhoretrm au ieu v er Ne2 gmanw,forwnlbsya apor tE.no
- euarisfatt e mealefedhsppmgAnlnoe(c -or)alat r lw o eb nglom,Ain
- one dtes ilhetcdba. t tg eturmudg,tfl1e1 v nitiaicynhrCsaemie-sp
- ncgHt nie cetrgmnoa yc r,ieaa toesa- e a0m82e1w shcnth ekh
- gaecnpeutaaieetgn iodhso d ro hAe snrsfcegrt NCsLc b17m8aEheideikfr
- aBercaeu thllnrshicwsg etriebruaisss d iorr."""
hackedMessage = self.hackTransposition(myMessage)
-
- if hackedMessage == None:
- print('Failed to hack encryption...')
- else:
- print('Copying hacked message to clipboard...')
- print(hackedMessage)
===========changed ref 2===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 55
- self.languageThreshold = 75
|
app.Decryptor.basicEncryption.transposition/Transposition.hackTransposition | Modified | Ciphey~Ciphey | 1f5a9080fdd4b4de2bdc722ce5ce7af0cc36a699 | goodbye! | <0>:<del> print('Attempting to hack message...')
<1>:<del> print('Press CTRL-C on Windows or CTRL-D on macOS or Linux to cancel....')
<2>:<add> print('Hacking...')
<3>:<add> # Python programs can be stopped at any time by pressing Ctrl-C (on
<add> # Windows) or Ctrl-D (on Mac and Linux)
<add>
<add> # brute-force by looping through every possible key
<del> # Loop over every key
<5>:<del> print('Attempting key #%s' % (key))
<6>:<del> if key >= 10:
<7>:<del> return None
<9>:<add> decryptedText = self.transpositionDecrypt.decryptMessage(key, message)
<del> decryptedText = self.decryptMessage(key, message)
<10>:<add>
<del> print('Key %s: %s' % (key, decryptedText[:100]))
<11>:<add> #if self.lc.checkLanguage(decryptedText):
<del> #if self.lc.checkLanguage(message):
<12>:<add> # Check with user to see if the decrypted key has been found.
<add> if self.lc.checkLanguage(decryptedText):
<add> return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key is {key}"}
<add> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
<del> # Ask if this is correct decryption!!!
<13>:<del>
<14>:<del> # If hack failed
| # module: app.Decryptor.basicEncryption.transposition
class Transposition:
def hackTransposition(self, message):
<0> print('Attempting to hack message...')
<1> print('Press CTRL-C on Windows or CTRL-D on macOS or Linux to cancel....')
<2>
<3> # Loop over every key
<4> for key in range(1, len(message)):
<5> print('Attempting key #%s' % (key))
<6> if key >= 10:
<7> return None
<8>
<9> decryptedText = self.decryptMessage(key, message)
<10> print('Key %s: %s' % (key, decryptedText[:100]))
<11> #if self.lc.checkLanguage(message):
<12> # Ask if this is correct decryption!!!
<13>
<14> # If hack failed
<15> return None
<16>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.transposition.Transposition.__init__
self.lc = lc
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
+
def decrypt(self, text):
# Brute-force by looping through every possible key.
- print(len(text))
- for key in range(1, len(text)):
- decryptedText = self.decryptMessage(key, text)
- print(decryptedText)
- if self.lc.checkLanguage(decryptedText):
- print("this is english according to lc")
- return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
- print("finished transposition")
-
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
+ decryptedText = self.hackTransposition("""ehlol ym aftehrh ellom ym ohteXrX""")
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def main(self):
+ myMessage = """Cb b rssti aieih rooaopbrtnsceee er es no npfgcwu plri
+
+ ch nitaalr eiuengiteehb(e1 hilincegeoamn fubehgtarndcstudmd nM eu eacBoltaetee
+
+ oinebcdkyremdteghn.aa2r81a condari fmps" tad l t oisn sit u1rnd stara nvhn fs
+
+ edbh ee,n e necrg6 8nmisv l nc muiftegiitm tutmg cm shSs9fcie ebintcaets h a
+
+ ihda cctrhe ele 1O7 aaoem waoaatdahretnhechaopnooeapece9etfncdbgsoeb uuteitgna.
+
+ rteoh add e,D7c1Etnpneehtn beete" evecoal lsfmcrl iu1cifgo ai. sl1rchdnheev sh
+
+ meBd ies e9t)nh,htcnoecplrrh ,ide hmtlme. pheaLem,toeinfgn t e9yce da' eN eMp a
+
+ ffn Fc1o ge eohg dere.eec s nfap yox hla yon. lnrnsreaBoa t,e eitsw il ulpbdofg
+
+ BRe bwlmprraio po droB wtinue r Pieno nc ayieeto'lulcih sfnc ownaSserbereiaSm
+
+ -eaiah, nnrttgcC maciiritvledastinideI nn rms iehn tsigaBmuoetcetias rn"""
- myMessage</s>
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def main(self):
# offset: 1
<s>iritvledastinideI nn rms iehn tsigaBmuoetcetias rn"""
- myMessage = """AaKoosoeDe5 b5sn ma reno ora'lhlrrceey e enlh
- na indeit n uhoretrm au ieu v er Ne2 gmanw,forwnlbsya apor tE.no
- euarisfatt e mealefedhsppmgAnlnoe(c -or)alat r lw o eb nglom,Ain
- one dtes ilhetcdba. t tg eturmudg,tfl1e1 v nitiaicynhrCsaemie-sp
- ncgHt nie cetrgmnoa yc r,ieaa toesa- e a0m82e1w shcnth ekh
- gaecnpeutaaieetgn iodhso d ro hAe snrsfcegrt NCsLc b17m8aEheideikfr
- aBercaeu thllnrshicwsg etriebruaisss d iorr."""
hackedMessage = self.hackTransposition(myMessage)
-
- if hackedMessage == None:
- print('Failed to hack encryption...')
- else:
- print('Copying hacked message to clipboard...')
- print(hackedMessage)
===========changed ref 3===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 55
- self.languageThreshold = 75
===========changed ref 4===========
# module: app.main
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Automated decryption tool. Put in the encrypted text and Ciphey will decrypt it.')
parser.add_argument('-f','--file', help='File you want to decrypt', required=False)
parser.add_argument('-l','--level', help='How many levels of decryption you want (the more levels, the slower it is)', required=False)
parser.add_argument('-g','--greppable', help='Are you grepping this output?', required=False)
+ parser.add_argument('-t','--text', help='Text to decrypt', required=False)
- parser.add_argument('-t','--text', help='Text to decrypt', required=True)
parser.add_argument('-s','--sicko-mode', help='If it is encrypted Ciphey WILL find it', required=False)
args = vars(parser.parse_args())
"""
██████╗██╗██████╗ ██╗ ██╗███████╗██╗ ██╗
██╔════╝██║██╔══██╗██║ ██║██╔════╝╚██╗ ██╔╝
�</s> |
app.Decryptor.basicEncryption.transposition/Transposition.decryptMessage | Modified | Ciphey~Ciphey | 1f5a9080fdd4b4de2bdc722ce5ce7af0cc36a699 | goodbye! | <0>:<del> # Simulate columns and rows of the grid the plaintext was written on
<1>:<del> numColumns = int(math.ceil(len(message) / float(key)))
<2>:<del> numRows = key
<3>:<del> numShadedBoxes = (numColumns * numRows) - len(message)
<4>:<add> # The transposition decrypt function will simulate the "columns" and
<add> # "rows" of the grid that the plaintext is written on by using a list
<add> # of strings. First, we need to calculate a few values.
<5>:<add> # The number of "columns" in our transposition grid:
<add> numOfColumns = math.ceil(len(message) / key)
<add> # The number of "rows" in our grid will need:
<add> numOfRows = key
<add> # The number of "shaded boxes" in the last "column" of the grid:
<add> numOfShadedBoxes = (numOfColumns * numOfRows) - len(message)
<del> # Each string in plaintext reprsents a column in the grid
<6>:<del> plaintext = [''] * numColumns
<8>:<add> # Each string in plaintext represents a column in the grid.
<add> plaintext = [''] * numOfColumns
<add>
<add> # The col and row variables point to where in the grid the next
<del> # The column and row variables point to the grid location of the next char
<9>:<add> # character in the encrypted message will go.
<del> # in the encrypted message
<10>:<add> col = 0
<del> column = 0
<13>:<add> | # module: app.Decryptor.basicEncryption.transposition
class Transposition:
def decryptMessage(self, key, message):
<0> # Simulate columns and rows of the grid the plaintext was written on
<1> numColumns = int(math.ceil(len(message) / float(key)))
<2> numRows = key
<3> numShadedBoxes = (numColumns * numRows) - len(message)
<4>
<5> # Each string in plaintext reprsents a column in the grid
<6> plaintext = [''] * numColumns
<7>
<8> # The column and row variables point to the grid location of the next char
<9> # in the encrypted message
<10> column = 0
<11> row = 0
<12>
<13> for character in message:
<14> plaintext[column] += character
<15> column += 1
<16>
<17> # If no more columns or empty bos, move to first column of next row
<18> if(column == numColumns) or (column == numColumns - 1 and row >= numRows - numShadedBoxes):
<19> column = 0
<20> row += 1
<21>
<22> return''.join(plaintext)
<23>
| ===========unchanged ref 0===========
at: math
ceil(x: SupportsFloat, /) -> int
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
+
def decrypt(self, text):
# Brute-force by looping through every possible key.
- print(len(text))
- for key in range(1, len(text)):
- decryptedText = self.decryptMessage(key, text)
- print(decryptedText)
- if self.lc.checkLanguage(decryptedText):
- print("this is english according to lc")
- return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key used is {key}"}
- print("finished transposition")
-
- return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
+ decryptedText = self.hackTransposition("""ehlol ym aftehrh ellom ym ohteXrX""")
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def hackTransposition(self, message):
- print('Attempting to hack message...')
- print('Press CTRL-C on Windows or CTRL-D on macOS or Linux to cancel....')
+ print('Hacking...')
+ # Python programs can be stopped at any time by pressing Ctrl-C (on
+ # Windows) or Ctrl-D (on Mac and Linux)
+
+ # brute-force by looping through every possible key
- # Loop over every key
for key in range(1, len(message)):
- print('Attempting key #%s' % (key))
- if key >= 10:
- return None
+ decryptedText = self.transpositionDecrypt.decryptMessage(key, message)
- decryptedText = self.decryptMessage(key, message)
+
- print('Key %s: %s' % (key, decryptedText[:100]))
+ #if self.lc.checkLanguage(decryptedText):
- #if self.lc.checkLanguage(message):
+ # Check with user to see if the decrypted key has been found.
+ if self.lc.checkLanguage(decryptedText):
+ return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Transposition", "Extra Information": f"The key is {key}"}
+ return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Transposition", "Extra Information": None}
- # Ask if this is correct decryption!!!
-
- # If hack failed
- return None
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def main(self):
+ myMessage = """Cb b rssti aieih rooaopbrtnsceee er es no npfgcwu plri
+
+ ch nitaalr eiuengiteehb(e1 hilincegeoamn fubehgtarndcstudmd nM eu eacBoltaetee
+
+ oinebcdkyremdteghn.aa2r81a condari fmps" tad l t oisn sit u1rnd stara nvhn fs
+
+ edbh ee,n e necrg6 8nmisv l nc muiftegiitm tutmg cm shSs9fcie ebintcaets h a
+
+ ihda cctrhe ele 1O7 aaoem waoaatdahretnhechaopnooeapece9etfncdbgsoeb uuteitgna.
+
+ rteoh add e,D7c1Etnpneehtn beete" evecoal lsfmcrl iu1cifgo ai. sl1rchdnheev sh
+
+ meBd ies e9t)nh,htcnoecplrrh ,ide hmtlme. pheaLem,toeinfgn t e9yce da' eN eMp a
+
+ ffn Fc1o ge eohg dere.eec s nfap yox hla yon. lnrnsreaBoa t,e eitsw il ulpbdofg
+
+ BRe bwlmprraio po droB wtinue r Pieno nc ayieeto'lulcih sfnc ownaSserbereiaSm
+
+ -eaiah, nnrttgcC maciiritvledastinideI nn rms iehn tsigaBmuoetcetias rn"""
- myMessage</s>
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.transposition
class Transposition:
def main(self):
# offset: 1
<s>iritvledastinideI nn rms iehn tsigaBmuoetcetias rn"""
- myMessage = """AaKoosoeDe5 b5sn ma reno ora'lhlrrceey e enlh
- na indeit n uhoretrm au ieu v er Ne2 gmanw,forwnlbsya apor tE.no
- euarisfatt e mealefedhsppmgAnlnoe(c -or)alat r lw o eb nglom,Ain
- one dtes ilhetcdba. t tg eturmudg,tfl1e1 v nitiaicynhrCsaemie-sp
- ncgHt nie cetrgmnoa yc r,ieaa toesa- e a0m82e1w shcnth ekh
- gaecnpeutaaieetgn iodhso d ro hAe snrsfcegrt NCsLc b17m8aEheideikfr
- aBercaeu thllnrshicwsg etriebruaisss d iorr."""
hackedMessage = self.hackTransposition(myMessage)
-
- if hackedMessage == None:
- print('Failed to hack encryption...')
- else:
- print('Copying hacked message to clipboard...')
- print(hackedMessage)
===========changed ref 4===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
+ self.languageThreshold = 55
- self.languageThreshold = 75
|
app.main/Ciphey.__init__ | Modified | Ciphey~Ciphey | 53891a50f8f707cbc0726e20aba737673fcf4645 | goodbye! | <13>:<add> self.level = 1
<del> self.level = level
<14>:<add> self.sickomode = False
<del> self.sickomode = sickomode
<15>:<add> self.cipher = cipher
| # module: app.main
class Ciphey:
+ def __init__(self, text, cipher):
- def __init__(self, text, level=1, sickomode=False):
<0> # general purpose modules
<1> self.ai = NeuralNetwork()
<2> self.lc = LanguageChecker()
<3> self.mh = mathsHelper.mathsHelper()
<4>
<5> # the one bit of text given to us to decrypt
<6> self.text = text
<7>
<8> # the decryptor components
<9> self.basic = BasicParent(self.lc)
<10> self.hash = HashParent()
<11> self.encoding = EncodingParent(self.lc)
<12>
<13> self.level = level
<14> self.sickomode = sickomode
<15>
| ===========unchanged ref 0===========
at: Decryptor.Encoding.encodingParent
EncodingParent(lc)
at: Decryptor.Hash.hashParent
HashParent()
at: Decryptor.basicEncryption.basic_parent
BasicParent(lc)
at: mathsHelper
mathsHelper()
at: neuralNetworkMod.nn
NeuralNetwork()
|
app.main/Ciphey.one_level_of_decryption | Modified | Ciphey~Ciphey | 53891a50f8f707cbc0726e20aba737673fcf4645 | goodbye! | <7>:<add> if self.cipher:
<add> if ret['Extra Information'] != None:
<add> print("The cipher used is", ret['Cipher'] + ".", ret['Extra Information'] + ".")
<add> else:
<add> print(ret['Cipher'])
<add>
| # module: app.main
class Ciphey:
def one_level_of_decryption(self, file=None, sickomode=None):
<0> for key, val in self.whatToChoose.items():
<1> # https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string
<2> if not isinstance(key, str):
<3> key.setProbTable(val)
<4> ret = key.decrypt(self.text)
<5> if ret['IsPlaintext?']:
<6> print(ret['Plaintext'])
<7> return ret
<8> print("No encryption found. Here's the probabilities we calculated")
<9> import pprint
<10> pprint.pprint(self.whatToChoose)
<11>
| ===========unchanged ref 0===========
at: Decryptor.Encoding.encodingParent.EncodingParent
setProbTable(table)
decrypt(text)
at: Decryptor.Hash.hashParent.HashParent
decrypt(text)
setProbTable(val)
at: Decryptor.basicEncryption.basic_parent.BasicParent
decrypt(text)
setProbTable(prob)
at: app.main.Ciphey.__init__
self.text = text
self.cipher = cipher
at: app.main.Ciphey.decrypt
self.whatToChoose = new_dict
self.whatToChoose = {self.hash:
{
"sha1": self.probabilityDistribution[0],
"md5": self.probabilityDistribution[1],
"sha256": self.probabilityDistribution[2],
"sha512": self.probabilityDistribution[3]
},
self.basic: {
"caesar": self.probabilityDistribution[4]
},
"plaintext": {
"plaintext": self.probabilityDistribution[5]
},
self.encoding:{
"reverse": self.probabilityDistribution[6],
"base64": self.probabilityDistribution[7],
"binary": self.probabilityDistribution[8],
"hexadecimal": self.probabilityDistribution[9],
"ascii": self.probabilityDistribution[10],
"morse": self.probabilityDistribution[11]
}
}
at: collections.OrderedDict
items() -> _OrderedDictItemsView[_KT, _VT]
===========changed ref 0===========
# module: app.main
class Ciphey:
+ def __init__(self, text, cipher):
- def __init__(self, text, level=1, sickomode=False):
# general purpose modules
self.ai = NeuralNetwork()
self.lc = LanguageChecker()
self.mh = mathsHelper.mathsHelper()
# the one bit of text given to us to decrypt
self.text = text
# the decryptor components
self.basic = BasicParent(self.lc)
self.hash = HashParent()
self.encoding = EncodingParent(self.lc)
+ self.level = 1
- self.level = level
+ self.sickomode = False
- self.sickomode = sickomode
+ self.cipher = cipher
|
app.Decryptor.basicEncryption.basic_parent/BasicParent.__init__ | Modified | Ciphey~Ciphey | 53891a50f8f707cbc0726e20aba737673fcf4645 | goodbye! | <7>:<add> self.list_of_objects = [self.caesar, self.reverse, self.pig]
<del> self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
| # module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
<0> self.lc = lc
<1> self.caesar = Caesar(self.lc)
<2> self.reverse = Reverse(self.lc)
<3> self.viginere = Viginere(self.lc)
<4> self.pig = PigLatin(self.lc)
<5> self.trans = Transposition(self.lc)
<6>
<7> self.list_of_objects = [self.caesar, self.reverse, self.pig, self.trans]
<8>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.caesar
Caesar(lc)
at: Decryptor.basicEncryption.pigLatin
PigLatin(lc)
at: Decryptor.basicEncryption.reverse
Reverse(lc)
at: Decryptor.basicEncryption.transposition
Transposition(lc)
at: Decryptor.basicEncryption.viginere
Viginere(lc)
at: app.Decryptor.basicEncryption.basic_parent.BasicParent.decrypt
self.lc = self.lc + answer["lc"]
===========changed ref 0===========
# module: app.main
class Ciphey:
+ def __init__(self, text, cipher):
- def __init__(self, text, level=1, sickomode=False):
# general purpose modules
self.ai = NeuralNetwork()
self.lc = LanguageChecker()
self.mh = mathsHelper.mathsHelper()
# the one bit of text given to us to decrypt
self.text = text
# the decryptor components
self.basic = BasicParent(self.lc)
self.hash = HashParent()
self.encoding = EncodingParent(self.lc)
+ self.level = 1
- self.level = level
+ self.sickomode = False
- self.sickomode = sickomode
+ self.cipher = cipher
===========changed ref 1===========
# module: app.main
class Ciphey:
def one_level_of_decryption(self, file=None, sickomode=None):
for key, val in self.whatToChoose.items():
# https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string
if not isinstance(key, str):
key.setProbTable(val)
ret = key.decrypt(self.text)
if ret['IsPlaintext?']:
print(ret['Plaintext'])
+ if self.cipher:
+ if ret['Extra Information'] != None:
+ print("The cipher used is", ret['Cipher'] + ".", ret['Extra Information'] + ".")
+ else:
+ print(ret['Cipher'])
+
return ret
print("No encryption found. Here's the probabilities we calculated")
import pprint
pprint.pprint(self.whatToChoose)
===========changed ref 2===========
# module: app.main
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Automated decryption tool. Put in the encrypted text and Ciphey will decrypt it.')
parser.add_argument('-f','--file', help='File you want to decrypt', required=False)
parser.add_argument('-l','--level', help='How many levels of decryption you want (the more levels, the slower it is)', required=False)
parser.add_argument('-g','--greppable', help='Are you grepping this output?', required=False)
parser.add_argument('-t','--text', help='Text to decrypt', required=False)
parser.add_argument('-s','--sicko-mode', help='If it is encrypted Ciphey WILL find it', required=False)
+ parser.add_argument('-c','--cipher', help='What is the cipher used?', required=False)
args = vars(parser.parse_args())
+ if args['cipher'] != None:
+ cipher = True
+ else:
+ cipher = False
"""
██████╗██╗██████╗ ██╗ ██╗███████╗██╗ ██╗
██╔════╝██║██╔══██╗██║ ██║██╔═══�</s>
===========changed ref 3===========
# module: app.main
# offset: 1
<s> ██║██╔════╝╚██╗ ██╔╝
██║ ██║██████╔╝███████║█████╗ ╚████╔╝
██║ ██║██╔═══╝ ██╔══██║██╔══╝ ╚██╔╝
╚██████╗██║██║ ██║ ██║███████╗ ██║
Made by Brandon Skerritt"""
#uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg
if args['text']:
+ cipherObj = Ciphey(args['text'], cipher</s>
===========changed ref 4===========
# module: app.main
# offset: 2
<s>
- #cipherObj = Ciphey(args['text'])
- cipherObj = Ciphey(""""AaKoosoeDe5 b5sn ma reno ora'lhlrrceey e enlh
- na indeit n uhoretrm au ieu v er Ne2 gmanw,forwnlbsya apor tE.no
- euarisfatt e mealefedhsppmgAnlnoe(c -or)alat r lw o eb nglom,Ain
- one dtes ilhetcdba. t tg eturmudg,tfl1e1 v nitiaicynhrCsaemie-sp
- ncgHt nie cetrgmnoa yc r,ieaa toesa- e a0m82e1w shcnth ekh
- gaecnpeutaaieetgn iodhso d ro hAe snrsfcegrt NCsLc b17m8aEheideikfr
- aBercaeu thllnrshicwsg etriebruaisss d iorr.""")
cipherObj.decrypt()
else:
print("You didn't supply any arguments")
|
app.languageCheckerMod.dictionaryChecker/dictionaryChecker.checkDictionary | Modified | Ciphey~Ciphey | f323c86c547720c35d64a880a1166ee5ca92cc44 | Fixed Language Checker Issues | <11>:<add> file = open("app/languageCheckerMod/English.txt", "r")
<del> file = open("languageCheckerMod/English.txt", "r")
| # module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def checkDictionary(self, text, language):
<0> """Compares a word with
<1> The dictionary is sorted and the text is sorted"""
<2> # reads through most common words / passwords
<3> # and calculates how much of that is in language
<4> text = text.lower()
<5> text = self.mh.stripPuncuation(text)
<6> text = text.split(" ")
<7> text = list(set(text)) # removes duplicate words
<8> text.sort()
<9> # can dynamically use languages then
<10> language = str(language) + ".txt"
<11> file = open("languageCheckerMod/English.txt", "r")
<12> f = file.readlines()
<13> file.close()
<14> f = [x.strip().lower() for x in f]
<15> # dictionary is "word\n" so I remove the "\n"
<16>
<17> # so this should loop until it gets to the point in the @staticmethod
<18> # that equals the word :)
<19>
<20> """
<21> for every single word in main dictionary
<22> if that word == text[0] then +1 to counter
<23> then +1 to text[0 + i]
<24> so say the dict is ordered
<25> we just loop through dict
<26> and eventually we'll reach a point where word in dict = word in text
<27> at that point, we move to the next text point
<28> both text and dict are sorted
<29> so we only loop once, we can do this in O(n log n) time
<30> """
<31> counter = 0
<32> counterPercent = 0
<33>
<34> for dictLengthCounter, word in enumerate(f):
<35> # if there is more words counted than there is text
<36> # it is 100%, sometimes it goes over
<37> # so this stops that
<38> if counter >= len(text):
<39> break
<40> # if the dictionary word is contained</s> | ===========below chunk 0===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def checkDictionary(self, text, language):
# offset: 1
# counter + 1
if word in text:
counter = counter + 1
counterPercent = counterPercent + 1
self.languageWordsCounter = counter
self.languagePercentage = self.mh.percentage(float(self.languageWordsCounter), float(len(text)))
return(counter)
===========unchanged ref 0===========
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker.__init__
self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
at: io.BufferedWriter
readlines(self, hint: int=..., /) -> List[bytes]
at: io.TextIOWrapper
close(self) -> None
at: mathsHelper.mathsHelper
percentage(part, whole)
stripPuncuation(text)
at: typing.IO
__slots__ = ()
close() -> None
readlines(hint: int=...) -> list[AnyStr]
|
app.main/Ciphey.__init__ | Modified | Ciphey~Ciphey | f323c86c547720c35d64a880a1166ee5ca92cc44 | Fixed Language Checker Issues | <2>:<add> self.lc = LanguageChecker.LanguageChecker()
<del> self.lc = LanguageChecker()
| # module: app.main
class Ciphey:
def __init__(self, text, cipher):
<0> # general purpose modules
<1> self.ai = NeuralNetwork()
<2> self.lc = LanguageChecker()
<3> self.mh = mathsHelper.mathsHelper()
<4>
<5> # the one bit of text given to us to decrypt
<6> self.text = text
<7>
<8> # the decryptor components
<9> self.basic = BasicParent(self.lc)
<10> self.hash = HashParent()
<11> self.encoding = EncodingParent(self.lc)
<12>
<13> self.level = 1
<14> self.sickomode = False
<15> self.cipher = cipher
<16>
| ===========unchanged ref 0===========
at: Decryptor.Encoding.encodingParent
EncodingParent(lc)
at: Decryptor.Hash.hashParent
HashParent()
at: Decryptor.basicEncryption.basic_parent
BasicParent(lc)
at: languageCheckerMod.LanguageChecker
LanguageChecker()
at: mathsHelper
mathsHelper()
at: neuralNetworkMod.nn
NeuralNetwork()
===========changed ref 0===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def checkDictionary(self, text, language):
"""Compares a word with
The dictionary is sorted and the text is sorted"""
# reads through most common words / passwords
# and calculates how much of that is in language
text = text.lower()
text = self.mh.stripPuncuation(text)
text = text.split(" ")
text = list(set(text)) # removes duplicate words
text.sort()
# can dynamically use languages then
language = str(language) + ".txt"
+ file = open("app/languageCheckerMod/English.txt", "r")
- file = open("languageCheckerMod/English.txt", "r")
f = file.readlines()
file.close()
f = [x.strip().lower() for x in f]
# dictionary is "word\n" so I remove the "\n"
# so this should loop until it gets to the point in the @staticmethod
# that equals the word :)
"""
for every single word in main dictionary
if that word == text[0] then +1 to counter
then +1 to text[0 + i]
so say the dict is ordered
we just loop through dict
and eventually we'll reach a point where word in dict = word in text
at that point, we move to the next text point
both text and dict are sorted
so we only loop once, we can do this in O(n log n) time
"""
counter = 0
counterPercent = 0
for dictLengthCounter, word in enumerate(f):
# if there is more words counted than there is text
# it is 100%, sometimes it goes over
# so this stops that
if counter >= len(text):
break
# if the dictionary word is contained in the text somewhere
# counter + 1
if word in text</s>
===========changed ref 1===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def checkDictionary(self, text, language):
# offset: 1
<s> break
# if the dictionary word is contained in the text somewhere
# counter + 1
if word in text:
counter = counter + 1
counterPercent = counterPercent + 1
self.languageWordsCounter = counter
self.languagePercentage = self.mh.percentage(float(self.languageWordsCounter), float(len(text)))
return(counter)
|
app.neuralNetworkMod.nn/NeuralNetwork.__init__ | Modified | Ciphey~Ciphey | f323c86c547720c35d64a880a1166ee5ca92cc44 | Fixed Language Checker Issues | <2>:<add> self.MODEL = load_model("app/neuralNetworkMod/NeuralNetworkModel.model")
<del> self.MODEL = load_model("neuralNetworkMod/NeuralNetworkModel.model")
| # module: app.neuralNetworkMod.nn
class NeuralNetwork:
def __init__(self):
<0> self.CATEGORIES = ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
<1> self.CATEGORIES = [1, 2, 3, 4, 5, 6]
<2> self.MODEL = load_model("neuralNetworkMod/NeuralNetworkModel.model")
<3> import mathsHelper
<4> self.mh = mathsHelper.mathsHelper()
<5>
| ===========unchanged ref 0===========
at: mathsHelper
mathsHelper()
===========changed ref 0===========
# module: app.main
class Ciphey:
def __init__(self, text, cipher):
# general purpose modules
self.ai = NeuralNetwork()
+ self.lc = LanguageChecker.LanguageChecker()
- self.lc = LanguageChecker()
self.mh = mathsHelper.mathsHelper()
# the one bit of text given to us to decrypt
self.text = text
# the decryptor components
self.basic = BasicParent(self.lc)
self.hash = HashParent()
self.encoding = EncodingParent(self.lc)
self.level = 1
self.sickomode = False
self.cipher = cipher
===========changed ref 1===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def checkDictionary(self, text, language):
"""Compares a word with
The dictionary is sorted and the text is sorted"""
# reads through most common words / passwords
# and calculates how much of that is in language
text = text.lower()
text = self.mh.stripPuncuation(text)
text = text.split(" ")
text = list(set(text)) # removes duplicate words
text.sort()
# can dynamically use languages then
language = str(language) + ".txt"
+ file = open("app/languageCheckerMod/English.txt", "r")
- file = open("languageCheckerMod/English.txt", "r")
f = file.readlines()
file.close()
f = [x.strip().lower() for x in f]
# dictionary is "word\n" so I remove the "\n"
# so this should loop until it gets to the point in the @staticmethod
# that equals the word :)
"""
for every single word in main dictionary
if that word == text[0] then +1 to counter
then +1 to text[0 + i]
so say the dict is ordered
we just loop through dict
and eventually we'll reach a point where word in dict = word in text
at that point, we move to the next text point
both text and dict are sorted
so we only loop once, we can do this in O(n log n) time
"""
counter = 0
counterPercent = 0
for dictLengthCounter, word in enumerate(f):
# if there is more words counted than there is text
# it is 100%, sometimes it goes over
# so this stops that
if counter >= len(text):
break
# if the dictionary word is contained in the text somewhere
# counter + 1
if word in text</s>
===========changed ref 2===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def checkDictionary(self, text, language):
# offset: 1
<s> break
# if the dictionary word is contained in the text somewhere
# counter + 1
if word in text:
counter = counter + 1
counterPercent = counterPercent + 1
self.languageWordsCounter = counter
self.languagePercentage = self.mh.percentage(float(self.languageWordsCounter), float(len(text)))
return(counter)
|
app.Decryptor.basicEncryption.basic_parent/BasicParent.__init__ | Modified | Ciphey~Ciphey | fe391c1df39d192a9f6e5f02424f07a2924cdbf1 | Merge remote-tracking branch 'origin/master' into AffineCipher | <5>:<add> # self.trans = Transposition(self.lc)
<del> self.trans = Transposition(self.lc)
| # module: app.Decryptor.basicEncryption.basic_parent
class BasicParent:
def __init__(self, lc):
<0> self.lc = lc
<1> self.caesar = Caesar(self.lc)
<2> self.reverse = Reverse(self.lc)
<3> self.viginere = Viginere(self.lc)
<4> self.pig = PigLatin(self.lc)
<5> self.trans = Transposition(self.lc)
<6>
<7> self.list_of_objects = [self.caesar, self.reverse, self.pig]
<8>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.caesar
Caesar(lc)
at: Decryptor.basicEncryption.pigLatin
PigLatin(lc)
at: Decryptor.basicEncryption.reverse
Reverse(lc)
at: Decryptor.basicEncryption.viginere
Viginere(lc)
at: app.Decryptor.basicEncryption.basic_parent.BasicParent.decrypt
self.lc = self.lc + answer["lc"]
|
app.Decryptor.basicEncryption.viginere/Viginere.attemptHackWithKeyLength | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <15>:<add> keyAndFreqMatchTuple = (possibleKey, app.Decryptor.basicEncryption.freqAnalysis.englishFreqMatchScore(decryptedText))
<del> keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
| # module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
<0> # Determine the most likely letters for each letter in the key:
<1> ciphertextUp = ciphertext.upper()
<2> # allFreqScores is a list of mostLikelyKeyLength number of lists.
<3> # These inner lists are the freqScores lists.
<4> allFreqScores = []
<5> for nth in range(1, mostLikelyKeyLength + 1):
<6> nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
<7>
<8> # freqScores is a list of tuples like:
<9> # [(<letter>, <Eng. Freq. match score>), ... ]
<10> # List is sorted by match score. Higher score means better match.
<11> # See the englishFreqMatchScore() comments in freqAnalysis.py.
<12> freqScores = []
<13> for possibleKey in self.LETTERS:
<14> decryptedText = self.decryptMessage(possibleKey, nthLetters)
<15> keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
<16> freqScores.append(keyAndFreqMatchTuple)
<17> # Sort by match score:
<18> freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
<19>
<20> allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
<21>
<22> if not self.SILENT_MODE:
<23> for i in range(len(allFreqScores)):
<24> # Use i + 1 so the first letter is not called the "0th" letter:
<25> print('Possible letters for letter %s of the key: ' % (i + 1), end='')
<26> for freqScore in allFreqScores[i]:
<27> print('%s ' % freqScore[0], end='')
<28> print() # Print a newline</s> | ===========below chunk 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 1
# Try every combination of the most likely letters for each position
# in the key:
for indexes in itertools.product(range(self.NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
# Create a possible key from the letters in allFreqScores:
possibleKey = ''
for i in range(mostLikelyKeyLength):
possibleKey += allFreqScores[i][indexes[i]][0]
if not self.SILENT_MODE:
print('Attempting with key: %s' % (possibleKey))
decryptedText = self.decryptMessage(possibleKey, ciphertextUp)
if self.lc.checkLanguage(decryptedText):
# Set the hacked ciphertext to the original casing:
origCase = []
for i in range(len(ciphertext)):
if ciphertext[i].isupper():
origCase.append(decryptedText[i].upper())
else:
origCase.append(decryptedText[i].lower())
decryptedText = ''.join(origCase)
# Check with user to see if the key has been found:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Viginere", "Extra Information": f"The key used is {possibleKey}"}
# No English-looking decryption found, so return None:
return None
===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.freqAnalysis
englishFreqMatchScore(message)
at: app.Decryptor.basicEncryption.viginere.Viginere
getItemAtIndexOne(items)
getNthSubkeysLetters(nth, keyLength, message)
decryptMessage(key, message)
at: app.Decryptor.basicEncryption.viginere.Viginere.__init__
self.LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.SILENT_MODE = True # If set to True, program doesn't print anything.
self.NUM_MOST_FREQ_LETTERS = 4 # Attempt this many letters per subkey.
self.lc = lc
===========unchanged ref 1===========
at: itertools
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]
product(*iterables: Iterable[_T1], repeat: int) -> Iterator[Tuple[_T1, ...]]
product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]
product(*iterables: Iterable[Any], repeat: int=...) -> Iterator[Tuple[Any, ...]]
product(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any], iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any], iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]
product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]
|
app.Decryptor.basicEncryption.caesar/Caesar.decrypt | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> """ Simple python program to bruteforce a caesar cipher"""
<del> ''' Simple python program to bruteforce a caesar cipher'''
<1>:<del>
<2>:<del> ''' Simple python program for the caesar cipher'''
<3>:<del>
| # module: app.Decryptor.basicEncryption.caesar
+ class Caesar:
- class Caesar():
+
def decrypt(self, message):
<0> ''' Simple python program to bruteforce a caesar cipher'''
<1>
<2> ''' Simple python program for the caesar cipher'''
<3>
<4>
<5> # Example string
<6> message = message.lower()
<7> # Everything we can encrypt
<8> SYMBOLS = 'abcdefghijklmnopqrstuvwxyz'
<9>
<10> for counter, key in enumerate(range(len(SYMBOLS))):
<11> # try again with each key attempt
<12> translated = ""
<13>
<14> for character in message:
<15> if character in SYMBOLS:
<16> symbolIndex = SYMBOLS.find(character)
<17> translatedIndex = symbolIndex - key
<18>
<19> # In the event of wraparound
<20> if translatedIndex < 0:
<21> translatedIndex += len(SYMBOLS)
<22>
<23> translated += SYMBOLS[translatedIndex]
<24>
<25> else:
<26> # Append the symbol without encrypting or decrypting
<27> translated += character
<28>
<29> # Output each attempt
<30> result = self.lc.checkLanguage(translated)
<31> if result:
<32> return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar", "Extra Information": f"The rotation used is {counter}"}
<33> # if none of them match English, return false!
<34> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Caesar", "Extra Information": None}
<35>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.caesar.Caesar.__init__
self.lc = lc
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# Determine the most likely letters for each letter in the key:
ciphertextUp = ciphertext.upper()
# allFreqScores is a list of mostLikelyKeyLength number of lists.
# These inner lists are the freqScores lists.
allFreqScores = []
for nth in range(1, mostLikelyKeyLength + 1):
nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
# freqScores is a list of tuples like:
# [(<letter>, <Eng. Freq. match score>), ... ]
# List is sorted by match score. Higher score means better match.
# See the englishFreqMatchScore() comments in freqAnalysis.py.
freqScores = []
for possibleKey in self.LETTERS:
decryptedText = self.decryptMessage(possibleKey, nthLetters)
+ keyAndFreqMatchTuple = (possibleKey, app.Decryptor.basicEncryption.freqAnalysis.englishFreqMatchScore(decryptedText))
- keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
freqScores.append(keyAndFreqMatchTuple)
# Sort by match score:
freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
if not self.SILENT_MODE:
for i in range(len(allFreqScores)):
# Use i + 1 so the first letter is not called the "0th" letter:
print('Possible letters for letter %s of the key: ' % (i + 1), end='')
for freqScore in allFreqScores[i]:
print('%s ' % freqScore[0], end='')
</s>
===========changed ref 1===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 1
<s>
for freqScore in allFreqScores[i]:
print('%s ' % freqScore[0], end='')
print() # Print a newline.
# Try every combination of the most likely letters for each position
# in the key:
for indexes in itertools.product(range(self.NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
# Create a possible key from the letters in allFreqScores:
possibleKey = ''
for i in range(mostLikelyKeyLength):
possibleKey += allFreqScores[i][indexes[i]][0]
if not self.SILENT_MODE:
print('Attempting with key: %s' % (possibleKey))
decryptedText = self.decryptMessage(possibleKey, ciphertextUp)
if self.lc.checkLanguage(decryptedText):
# Set the hacked ciphertext to the original casing:
origCase = []
for i in range(len(ciphertext)):
if ciphertext[i].isupper():
origCase.append(decryptedText[i].upper())
else:
origCase.append(decryptedText[i].lower())
decryptedText = ''.join(origCase)
# Check with user to see if the key has been found:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Viginere", "Extra Information": f"The key used is {possibleKey}"}
# No English-looking decryption found, so return None:
return None
|
app.Tests.test_caesarcipher_basic/TestChi.test_caesar_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <1>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
<2>:<add> c = Caesar.Caesar(lc)
<del> c = Caesar(lc)
| <s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
<0> """Checks to see if it returns True (it should)"""
<1> lc = LanguageChecker()
<2> c = Caesar(lc)
<3> result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
<4> self.assertEqual(result['IsPlaintext?'], True)
<5>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: unittest.case
TestCase(methodName: str=...)
===========changed ref 0===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 1===========
+ # module: app.Decryptor
+
+
===========changed ref 2===========
# module: app.Decryptor.basicEncryption.caesar
+ class Caesar:
- class Caesar():
+
def decrypt(self, message):
+ """ Simple python program to bruteforce a caesar cipher"""
- ''' Simple python program to bruteforce a caesar cipher'''
-
- ''' Simple python program for the caesar cipher'''
-
# Example string
message = message.lower()
# Everything we can encrypt
SYMBOLS = 'abcdefghijklmnopqrstuvwxyz'
for counter, key in enumerate(range(len(SYMBOLS))):
# try again with each key attempt
translated = ""
for character in message:
if character in SYMBOLS:
symbolIndex = SYMBOLS.find(character)
translatedIndex = symbolIndex - key
# In the event of wraparound
if translatedIndex < 0:
translatedIndex += len(SYMBOLS)
translated += SYMBOLS[translatedIndex]
else:
# Append the symbol without encrypting or decrypting
translated += character
# Output each attempt
result = self.lc.checkLanguage(translated)
if result:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar", "Extra Information": f"The rotation used is {counter}"}
# if none of them match English, return false!
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Caesar", "Extra Information": None}
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# Determine the most likely letters for each letter in the key:
ciphertextUp = ciphertext.upper()
# allFreqScores is a list of mostLikelyKeyLength number of lists.
# These inner lists are the freqScores lists.
allFreqScores = []
for nth in range(1, mostLikelyKeyLength + 1):
nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
# freqScores is a list of tuples like:
# [(<letter>, <Eng. Freq. match score>), ... ]
# List is sorted by match score. Higher score means better match.
# See the englishFreqMatchScore() comments in freqAnalysis.py.
freqScores = []
for possibleKey in self.LETTERS:
decryptedText = self.decryptMessage(possibleKey, nthLetters)
+ keyAndFreqMatchTuple = (possibleKey, app.Decryptor.basicEncryption.freqAnalysis.englishFreqMatchScore(decryptedText))
- keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
freqScores.append(keyAndFreqMatchTuple)
# Sort by match score:
freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
if not self.SILENT_MODE:
for i in range(len(allFreqScores)):
# Use i + 1 so the first letter is not called the "0th" letter:
print('Possible letters for letter %s of the key: ' % (i + 1), end='')
for freqScore in allFreqScores[i]:
print('%s ' % freqScore[0], end='')
</s>
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 1
<s>
for freqScore in allFreqScores[i]:
print('%s ' % freqScore[0], end='')
print() # Print a newline.
# Try every combination of the most likely letters for each position
# in the key:
for indexes in itertools.product(range(self.NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
# Create a possible key from the letters in allFreqScores:
possibleKey = ''
for i in range(mostLikelyKeyLength):
possibleKey += allFreqScores[i][indexes[i]][0]
if not self.SILENT_MODE:
print('Attempting with key: %s' % (possibleKey))
decryptedText = self.decryptMessage(possibleKey, ciphertextUp)
if self.lc.checkLanguage(decryptedText):
# Set the hacked ciphertext to the original casing:
origCase = []
for i in range(len(ciphertext)):
if ciphertext[i].isupper():
origCase.append(decryptedText[i].upper())
else:
origCase.append(decryptedText[i].lower())
decryptedText = ''.join(origCase)
# Check with user to see if the key has been found:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Viginere", "Extra Information": f"The key used is {possibleKey}"}
# No English-looking decryption found, so return None:
return None
|
app.Tests.test_caesarcipher_basic/TestChi.test_caesar_no | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <1>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
<2>:<add> c = Caesar.Caesar(lc)
<del> c = Caesar(lc)
| <s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
<0> """Checks to see if it returns True (it should)"""
<1> lc = LanguageChecker()
<2> c = Caesar(lc)
<3> result = c.decrypt("o iozad iikwas")
<4> self.assertEqual(result['IsPlaintext?'], False)
<5>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.caesar
Caesar(lc)
at: app.Tests.test_caesarcipher_basic.TestChi.test_caesar_yes
lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
at: unittest.case.TestCase
failureException: Type[BaseException]
longMessage: bool
maxDiff: Optional[int]
_testMethodName: str
_testMethodDoc: str
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 1===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 2===========
+ # module: app.Decryptor
+
+
===========changed ref 3===========
# module: app.Decryptor.basicEncryption.caesar
+ class Caesar:
- class Caesar():
+
def decrypt(self, message):
+ """ Simple python program to bruteforce a caesar cipher"""
- ''' Simple python program to bruteforce a caesar cipher'''
-
- ''' Simple python program for the caesar cipher'''
-
# Example string
message = message.lower()
# Everything we can encrypt
SYMBOLS = 'abcdefghijklmnopqrstuvwxyz'
for counter, key in enumerate(range(len(SYMBOLS))):
# try again with each key attempt
translated = ""
for character in message:
if character in SYMBOLS:
symbolIndex = SYMBOLS.find(character)
translatedIndex = symbolIndex - key
# In the event of wraparound
if translatedIndex < 0:
translatedIndex += len(SYMBOLS)
translated += SYMBOLS[translatedIndex]
else:
# Append the symbol without encrypting or decrypting
translated += character
# Output each attempt
result = self.lc.checkLanguage(translated)
if result:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar", "Extra Information": f"The rotation used is {counter}"}
# if none of them match English, return false!
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Caesar", "Extra Information": None}
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# Determine the most likely letters for each letter in the key:
ciphertextUp = ciphertext.upper()
# allFreqScores is a list of mostLikelyKeyLength number of lists.
# These inner lists are the freqScores lists.
allFreqScores = []
for nth in range(1, mostLikelyKeyLength + 1):
nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
# freqScores is a list of tuples like:
# [(<letter>, <Eng. Freq. match score>), ... ]
# List is sorted by match score. Higher score means better match.
# See the englishFreqMatchScore() comments in freqAnalysis.py.
freqScores = []
for possibleKey in self.LETTERS:
decryptedText = self.decryptMessage(possibleKey, nthLetters)
+ keyAndFreqMatchTuple = (possibleKey, app.Decryptor.basicEncryption.freqAnalysis.englishFreqMatchScore(decryptedText))
- keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
freqScores.append(keyAndFreqMatchTuple)
# Sort by match score:
freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
if not self.SILENT_MODE:
for i in range(len(allFreqScores)):
# Use i + 1 so the first letter is not called the "0th" letter:
print('Possible letters for letter %s of the key: ' % (i + 1), end='')
for freqScore in allFreqScores[i]:
print('%s ' % freqScore[0], end='')
</s>
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# offset: 1
<s>
for freqScore in allFreqScores[i]:
print('%s ' % freqScore[0], end='')
print() # Print a newline.
# Try every combination of the most likely letters for each position
# in the key:
for indexes in itertools.product(range(self.NUM_MOST_FREQ_LETTERS), repeat=mostLikelyKeyLength):
# Create a possible key from the letters in allFreqScores:
possibleKey = ''
for i in range(mostLikelyKeyLength):
possibleKey += allFreqScores[i][indexes[i]][0]
if not self.SILENT_MODE:
print('Attempting with key: %s' % (possibleKey))
decryptedText = self.decryptMessage(possibleKey, ciphertextUp)
if self.lc.checkLanguage(decryptedText):
# Set the hacked ciphertext to the original casing:
origCase = []
for i in range(len(ciphertext)):
if ciphertext[i].isupper():
origCase.append(decryptedText[i].upper())
else:
origCase.append(decryptedText[i].lower())
decryptedText = ''.join(origCase)
# Check with user to see if the key has been found:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": decryptedText, "Cipher": "Viginere", "Extra Information": f"The key used is {possibleKey}"}
# No English-looking decryption found, so return None:
return None
|
app.Tests.test_caesarcipher_basic/TestChi.test_caesar_plaintext_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <3>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
<4>:<add> c = Caesar.Caesar(lc)
<del> c = Caesar(lc)
| <s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
<0> """Checks to see if it returns True (it should)
<1> Ok so this returns false becaues caesar only does up to 25, not 26
<2> so plaintext returns false!"""
<3> lc = LanguageChecker()
<4> c = Caesar(lc)
<5> result = c.decrypt("What about plaintext?")
<6> self.assertEqual(result['IsPlaintext?'], True)
<7>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.caesar
Caesar(lc)
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 1===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 2===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
+ # module: app.Decryptor
+
+
===========changed ref 4===========
# module: app.Decryptor.basicEncryption.caesar
+ class Caesar:
- class Caesar():
+
def decrypt(self, message):
+ """ Simple python program to bruteforce a caesar cipher"""
- ''' Simple python program to bruteforce a caesar cipher'''
-
- ''' Simple python program for the caesar cipher'''
-
# Example string
message = message.lower()
# Everything we can encrypt
SYMBOLS = 'abcdefghijklmnopqrstuvwxyz'
for counter, key in enumerate(range(len(SYMBOLS))):
# try again with each key attempt
translated = ""
for character in message:
if character in SYMBOLS:
symbolIndex = SYMBOLS.find(character)
translatedIndex = symbolIndex - key
# In the event of wraparound
if translatedIndex < 0:
translatedIndex += len(SYMBOLS)
translated += SYMBOLS[translatedIndex]
else:
# Append the symbol without encrypting or decrypting
translated += character
# Output each attempt
result = self.lc.checkLanguage(translated)
if result:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar", "Extra Information": f"The rotation used is {counter}"}
# if none of them match English, return false!
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Caesar", "Extra Information": None}
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# Determine the most likely letters for each letter in the key:
ciphertextUp = ciphertext.upper()
# allFreqScores is a list of mostLikelyKeyLength number of lists.
# These inner lists are the freqScores lists.
allFreqScores = []
for nth in range(1, mostLikelyKeyLength + 1):
nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
# freqScores is a list of tuples like:
# [(<letter>, <Eng. Freq. match score>), ... ]
# List is sorted by match score. Higher score means better match.
# See the englishFreqMatchScore() comments in freqAnalysis.py.
freqScores = []
for possibleKey in self.LETTERS:
decryptedText = self.decryptMessage(possibleKey, nthLetters)
+ keyAndFreqMatchTuple = (possibleKey, app.Decryptor.basicEncryption.freqAnalysis.englishFreqMatchScore(decryptedText))
- keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
freqScores.append(keyAndFreqMatchTuple)
# Sort by match score:
freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
if not self.SILENT_MODE:
for i in range(len(allFreqScores)):
# Use i + 1 so the first letter is not called the "0th" letter:
print('Possible letters for letter %s of the key: ' % (i + 1), end='')
for freqScore in allFreqScores[i]:
print('%s ' % freqScore[0], end='')
</s> |
app.Tests.test_caesarcipher_basic/TestChi.test_caesar_english_comparison | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
<1>:<add> c = Caesar.Caesar(lc)
<del> c = Caesar(lc)
| <s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison(self):
<0> lc = LanguageChecker()
<1> c = Caesar(lc)
<2> result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
<3> self.assertEqual(result['IsPlaintext?'], True)
<4>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.caesar
Caesar(lc)
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 1===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 2===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 4===========
+ # module: app.Decryptor
+
+
===========changed ref 5===========
# module: app.Decryptor.basicEncryption.caesar
+ class Caesar:
- class Caesar():
+
def decrypt(self, message):
+ """ Simple python program to bruteforce a caesar cipher"""
- ''' Simple python program to bruteforce a caesar cipher'''
-
- ''' Simple python program for the caesar cipher'''
-
# Example string
message = message.lower()
# Everything we can encrypt
SYMBOLS = 'abcdefghijklmnopqrstuvwxyz'
for counter, key in enumerate(range(len(SYMBOLS))):
# try again with each key attempt
translated = ""
for character in message:
if character in SYMBOLS:
symbolIndex = SYMBOLS.find(character)
translatedIndex = symbolIndex - key
# In the event of wraparound
if translatedIndex < 0:
translatedIndex += len(SYMBOLS)
translated += SYMBOLS[translatedIndex]
else:
# Append the symbol without encrypting or decrypting
translated += character
# Output each attempt
result = self.lc.checkLanguage(translated)
if result:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar", "Extra Information": f"The rotation used is {counter}"}
# if none of them match English, return false!
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Caesar", "Extra Information": None}
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.viginere
class Viginere:
def attemptHackWithKeyLength(self, ciphertext, mostLikelyKeyLength):
# Determine the most likely letters for each letter in the key:
ciphertextUp = ciphertext.upper()
# allFreqScores is a list of mostLikelyKeyLength number of lists.
# These inner lists are the freqScores lists.
allFreqScores = []
for nth in range(1, mostLikelyKeyLength + 1):
nthLetters = self.getNthSubkeysLetters(nth, mostLikelyKeyLength, ciphertextUp)
# freqScores is a list of tuples like:
# [(<letter>, <Eng. Freq. match score>), ... ]
# List is sorted by match score. Higher score means better match.
# See the englishFreqMatchScore() comments in freqAnalysis.py.
freqScores = []
for possibleKey in self.LETTERS:
decryptedText = self.decryptMessage(possibleKey, nthLetters)
+ keyAndFreqMatchTuple = (possibleKey, app.Decryptor.basicEncryption.freqAnalysis.englishFreqMatchScore(decryptedText))
- keyAndFreqMatchTuple = (possibleKey, freqAnalysis.englishFreqMatchScore(decryptedText))
freqScores.append(keyAndFreqMatchTuple)
# Sort by match score:
freqScores.sort(key=self.getItemAtIndexOne, reverse=True)
allFreqScores.append(freqScores[:self.NUM_MOST_FREQ_LETTERS])
if not self.SILENT_MODE:
for i in range(len(allFreqScores)):
# Use i + 1 so the first letter is not called the "0th" letter:
print('Possible letters for letter %s of the key: ' % (i + 1), end='')
for freqScore in allFreqScores[i]:
print('%s ' % freqScore[0], end='')
</s> |
app.Tests.test_caesarcipher_basic/TestChi.test_caesar_english_comparison_yeet | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
<1>:<add> c = Caesar.Caesar(lc)
<del> c = Caesar(lc)
| <s>arcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison_yeet(self):
<0> lc = LanguageChecker()
<1> c = Caesar(lc)
<2> result = c.decrypt("Onrs hr mnv knbjdc enq fnnc. Sgzmj xnt zkk enq ozqshbhozshmf, zmc okdzrd bnmshmtd sn unsd enq sgd itcfdldms xnt zfqdd vhsg. Zr nsgdq trdqr gzud onhmsdc nts, sgdqd hr zcchshnmzk hmenqlzshnm sgzs NO gzr kdes nts ne sgdhq nqhfhmzk onrs sgzs sgdx gzud zccdc hm sgdhq bnlldmsr, rn okdzrd qdzc etqsgdq sn fds sgd etkk rbnod ne sgd rhstzshnm.")
<3> self.assertEqual(result['Plaintext'], "Post is now locked for good. Thank you all for participating, and please continue to vote for the judgement you agree with. As other users have pointed out, there is additional information that OP has left out of their original post that they have added in their comments, so please read further to get the full scope of the situation.".lower())
<4>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.caesar
Caesar(lc)
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
===========changed ref 0===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 1===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 2===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 4===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 5===========
+ # module: app.Decryptor
+
+
===========changed ref 6===========
# module: app.Decryptor.basicEncryption.caesar
+ class Caesar:
- class Caesar():
+
def decrypt(self, message):
+ """ Simple python program to bruteforce a caesar cipher"""
- ''' Simple python program to bruteforce a caesar cipher'''
-
- ''' Simple python program for the caesar cipher'''
-
# Example string
message = message.lower()
# Everything we can encrypt
SYMBOLS = 'abcdefghijklmnopqrstuvwxyz'
for counter, key in enumerate(range(len(SYMBOLS))):
# try again with each key attempt
translated = ""
for character in message:
if character in SYMBOLS:
symbolIndex = SYMBOLS.find(character)
translatedIndex = symbolIndex - key
# In the event of wraparound
if translatedIndex < 0:
translatedIndex += len(SYMBOLS)
translated += SYMBOLS[translatedIndex]
else:
# Append the symbol without encrypting or decrypting
translated += character
# Output each attempt
result = self.lc.checkLanguage(translated)
if result:
return {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar", "Extra Information": f"The rotation used is {counter}"}
# if none of them match English, return false!
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": "Caesar", "Extra Information": None}
|
app.Tests.test_caesarcipher_basic/TestChi.test_caesar_what_is_this | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <3>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
<4>:<add> c = Caesar.Caesar(lc)
<del> c = Caesar(lc)
| <s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
<0> """Checks to see if it returns True (it should)
<1> Ok so this returns false becaues caesar only does up to 25, not 26
<2> so plaintext returns false!"""
<3> lc = LanguageChecker()
<4> c = Caesar(lc)
<5> result = c.decrypt("?")
<6> self.assertEqual(result['IsPlaintext?'], False)
<7>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.caesar
Caesar(lc)
at: app.Tests.test_caesarcipher_basic.TestChi.test_caesar_english_comparison
result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 1===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 2===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 4===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 5===========
<s>arcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison_yeet(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("Onrs hr mnv knbjdc enq fnnc. Sgzmj xnt zkk enq ozqshbhozshmf, zmc okdzrd bnmshmtd sn unsd enq sgd itcfdldms xnt zfqdd vhsg. Zr nsgdq trdqr gzud onhmsdc nts, sgdqd hr zcchshnmzk hmenqlzshnm sgzs NO gzr kdes nts ne sgdhq nqhfhmzk onrs sgzs sgdx gzud zccdc hm sgdhq bnlldmsr, rn okdzrd qdzc etqsgdq sn fds sgd etkk rbnod ne sgd rhstzshnm.")
self.assertEqual(result['Plaintext'], "Post is now locked for good. Thank you all for participating, and please continue to vote for the judgement you agree with. As other users have pointed out, there is additional information that OP has left out of their original post that they have added in their comments, so please read further to get the full scope of the situation.".lower())
===========changed ref 6===========
+ # module: app.Decryptor
+
+ |
app.Decryptor.basicEncryption.basic_parent/BasicParent.__init__ | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <1>:<add> self.caesar = app.Decryptor.basicEncryption.caesar.Caesar(self.lc)
<add> self.reverse = app.Decryptor.basicEncryption.reverse.Reverse(self.lc)
<add> self.viginere = app.Decryptor.basicEncryption.viginere.Viginere(self.lc)
<add> self.pig = app.Decryptor.basicEncryption.pigLatin.PigLatin(self.lc)
<del> self.caesar = Caesar(self.lc)
<2>:<del> self.reverse = Reverse(self.lc)
<3>:<del> self.viginere = Viginere(self.lc)
<4>:<del> self.pig = PigLatin(self.lc)
| # module: app.Decryptor.basicEncryption.basic_parent
+
class BasicParent:
def __init__(self, lc):
<0> self.lc = lc
<1> self.caesar = Caesar(self.lc)
<2> self.reverse = Reverse(self.lc)
<3> self.viginere = Viginere(self.lc)
<4> self.pig = PigLatin(self.lc)
<5> # self.trans = Transposition(self.lc)
<6>
<7> self.list_of_objects = [self.caesar, self.reverse, self.pig]
<8>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.caesar
Caesar(lc)
at: Decryptor.basicEncryption.pigLatin
PigLatin(lc)
at: Decryptor.basicEncryption.reverse
Reverse(lc)
at: Decryptor.basicEncryption.viginere
Viginere(lc)
at: app.Decryptor.basicEncryption.basic_parent.BasicParent.decrypt
self.lc = self.lc + answer["lc"]
===========changed ref 0===========
+ # module: app.Decryptor
+
+
===========changed ref 1===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 2===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 3===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 4===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 5===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 6===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 7===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 8===========
<s>arcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison_yeet(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("Onrs hr mnv knbjdc enq fnnc. Sgzmj xnt zkk enq ozqshbhozshmf, zmc okdzrd bnmshmtd sn unsd enq sgd itcfdldms xnt zfqdd vhsg. Zr nsgdq trdqr gzud onhmsdc nts, sgdqd hr zcchshnmzk hmenqlzshnm sgzs NO gzr kdes nts ne sgdhq nqhfhmzk onrs sgzs sgdx gzud zccdc hm sgdhq bnlldmsr, rn okdzrd qdzc etqsgdq sn fds sgd etkk rbnod ne sgd rhstzshnm.")
self.assertEqual(result['Plaintext'], "Post is now locked for good. Thank you all for participating, and please continue to vote for the judgement you agree with. As other users have pointed out, there is additional information that OP has left out of their original post that they have added in their comments, so please read further to get the full scope of the situation.".lower())
|
app.Decryptor.basicEncryption.basic_parent/BasicParent.decrypt | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <1>:<del>
| # module: app.Decryptor.basicEncryption.basic_parent
+
class BasicParent:
+
def decrypt(self, text):
<0> self.text = text
<1>
<2> from multiprocessing.dummy import Pool as ThreadPool
<3> pool = ThreadPool(4)
<4> answers = pool.map(self.callDecrypt, self.list_of_objects)
<5>
<6> """for item in self.list_of_objects:
<7> result = item.decrypt(text)
<8> answers.append(result)"""
<9> for answer in answers:
<10> # adds the LC objects together
<11> self.lc = self.lc + answer["lc"]
<12> if answer["IsPlaintext?"]:
<13> return answer
<14>
<15> # so viginere runs ages
<16> # and you cant kill threads in a pool
<17> # so i just run it last lol
<18> result = self.callDecrypt(self.viginere)
<19> if result["IsPlaintext?"]:
<20> return result
<21> return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
<22>
| ===========unchanged ref 0===========
at: app.Decryptor.basicEncryption.basic_parent.BasicParent
callDecrypt(obj)
at: app.Decryptor.basicEncryption.basic_parent.BasicParent.__init__
self.lc = lc
self.viginere = Viginere(self.lc)
self.list_of_objects = [self.caesar, self.reverse, self.pig]
at: multiprocessing.dummy
Pool(processes: Optional[int]=..., initializer: Optional[Callable[..., Any]]=..., initargs: Iterable[Any]=...) -> Any
===========changed ref 0===========
# module: app.Decryptor.basicEncryption.basic_parent
+
class BasicParent:
def __init__(self, lc):
self.lc = lc
+ self.caesar = app.Decryptor.basicEncryption.caesar.Caesar(self.lc)
+ self.reverse = app.Decryptor.basicEncryption.reverse.Reverse(self.lc)
+ self.viginere = app.Decryptor.basicEncryption.viginere.Viginere(self.lc)
+ self.pig = app.Decryptor.basicEncryption.pigLatin.PigLatin(self.lc)
- self.caesar = Caesar(self.lc)
- self.reverse = Reverse(self.lc)
- self.viginere = Viginere(self.lc)
- self.pig = PigLatin(self.lc)
# self.trans = Transposition(self.lc)
self.list_of_objects = [self.caesar, self.reverse, self.pig]
===========changed ref 1===========
+ # module: app.Decryptor
+
+
===========changed ref 2===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 3===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 4===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 5===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 6===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 7===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 8===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
self.assertEqual(result['IsPlaintext?'], True)
|
app.languageCheckerMod.dictionaryChecker/dictionaryChecker.__init__ | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> self.mh = app.mathsHelper.mathsHelper()
<del> self.mh = mathsHelper.mathsHelper()
| # module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
<0> self.mh = mathsHelper.mathsHelper()
<1> self.languagePercentage = 0.0
<2> self.languageWordsCounter = 0.0
<3> self.languageThreshold = 55
<4>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker.checkDictionary
self.languageWordsCounter = counter
self.languagePercentage = self.mh.percentage(float(self.languageWordsCounter), float(len(text)))
at: app.mathsHelper
mathsHelper()
===========changed ref 0===========
+ # module: app.Decryptor
+
+
===========changed ref 1===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 2===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 3===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 4===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 5===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 6===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 7===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 8===========
# module: app.Decryptor.basicEncryption.basic_parent
+
class BasicParent:
def __init__(self, lc):
self.lc = lc
+ self.caesar = app.Decryptor.basicEncryption.caesar.Caesar(self.lc)
+ self.reverse = app.Decryptor.basicEncryption.reverse.Reverse(self.lc)
+ self.viginere = app.Decryptor.basicEncryption.viginere.Viginere(self.lc)
+ self.pig = app.Decryptor.basicEncryption.pigLatin.PigLatin(self.lc)
- self.caesar = Caesar(self.lc)
- self.reverse = Reverse(self.lc)
- self.viginere = Viginere(self.lc)
- self.pig = PigLatin(self.lc)
# self.trans = Transposition(self.lc)
self.list_of_objects = [self.caesar, self.reverse, self.pig]
===========changed ref 9===========
# module: app.Decryptor.basicEncryption.basic_parent
+
class BasicParent:
+
def decrypt(self, text):
self.text = text
-
from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
answers = pool.map(self.callDecrypt, self.list_of_objects)
"""for item in self.list_of_objects:
result = item.decrypt(text)
answers.append(result)"""
for answer in answers:
# adds the LC objects together
self.lc = self.lc + answer["lc"]
if answer["IsPlaintext?"]:
return answer
# so viginere runs ages
# and you cant kill threads in a pool
# so i just run it last lol
result = self.callDecrypt(self.viginere)
if result["IsPlaintext?"]:
return result
return {"lc": self.lc, "IsPlaintext?": False, "Plaintext": None, "Cipher": None, "Extra Information": None}
|
app.languageCheckerMod.dictionaryChecker/dictionaryChecker.checkDictionary | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <32>:<add> counter_percent = 0
<del> counterPercent = 0
| # module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
+
def checkDictionary(self, text, language):
<0> """Compares a word with
<1> The dictionary is sorted and the text is sorted"""
<2> # reads through most common words / passwords
<3> # and calculates how much of that is in language
<4> text = text.lower()
<5> text = self.mh.stripPuncuation(text)
<6> text = text.split(" ")
<7> text = list(set(text)) # removes duplicate words
<8> text.sort()
<9> # can dynamically use languages then
<10> language = str(language) + ".txt"
<11> file = open("app/languageCheckerMod/English.txt", "r")
<12> f = file.readlines()
<13> file.close()
<14> f = [x.strip().lower() for x in f]
<15> # dictionary is "word\n" so I remove the "\n"
<16>
<17> # so this should loop until it gets to the point in the @staticmethod
<18> # that equals the word :)
<19>
<20> """
<21> for every single word in main dictionary
<22> if that word == text[0] then +1 to counter
<23> then +1 to text[0 + i]
<24> so say the dict is ordered
<25> we just loop through dict
<26> and eventually we'll reach a point where word in dict = word in text
<27> at that point, we move to the next text point
<28> both text and dict are sorted
<29> so we only loop once, we can do this in O(n log n) time
<30> """
<31> counter = 0
<32> counterPercent = 0
<33>
<34> for dictLengthCounter, word in enumerate(f):
<35> # if there is more words counted than there is text
<36> # it is 100%, sometimes it goes over
<37> # so this stops that
<38> if counter >= len(text):
<39> break
<40> # if</s> | ===========below chunk 0===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
+
def checkDictionary(self, text, language):
# offset: 1
# counter + 1
if word in text:
counter = counter + 1
counterPercent = counterPercent + 1
self.languageWordsCounter = counter
self.languagePercentage = self.mh.percentage(float(self.languageWordsCounter), float(len(text)))
return(counter)
===========unchanged ref 0===========
at: app.languageCheckerMod.dictionaryChecker.dictionaryChecker.__init__
self.mh = app.mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
at: app.mathsHelper.mathsHelper
percentage(part, whole)
stripPuncuation(text)
at: io.TextIOWrapper
close(self) -> None
readlines(self, hint: int=..., /) -> List[str]
at: typing.IO
__slots__ = ()
close() -> None
readlines(hint: int=...) -> list[AnyStr]
===========changed ref 0===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 1===========
+ # module: app.Decryptor
+
+
===========changed ref 2===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 3===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 4===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 5===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 6===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 7===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 8===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
self.assertEqual(result['IsPlaintext?'], True)
|
app.Tests.test_chi_squared/TestChi.test_chi_english_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <1>:<add> self.chi = app.languageCheckerMod.chisquared.chiSquared()
<del> self.chi = chisquared.chiSquared()
| # module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
<0> """Checks to see if it returns True (it should)"""
<1> self.chi = chisquared.chiSquared()
<2> """
<3> Tests to see whether a sentene is classified as English or not
<4> """
<5> result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
<6> self.assertEqual(result, True)
<7>
| ===========unchanged ref 0===========
at: app.Tests.test_chi_squared.TestChi.test_chi_english_caps
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_one_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_puncuation
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_quckbrown
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_same_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_my_chi
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_no_words
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_overflow
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.languageCheckerMod.chisquared
chiSquared()
at: app.languageCheckerMod.chisquared.chiSquared
checkChi(text)
at: unittest.case.TestCase
failureException: Type[BaseException]
longMessage: bool
maxDiff: Optional[int]
_testMethodName: str
_testMethodDoc: str
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
+ # module: app.Decryptor
+
+
===========changed ref 1===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 2===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 3===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 4===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 5===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 6===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 7===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 8===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_english_comparison(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("Pm ol ohk hufaopun jvumpkluaphs av zhf, ol dyval pa pu jpwoly, aoha pz, if zv johunpun aol vykly vm aol slaalyz vm aol hswohila, aoha uva h dvyk jvbsk il thkl vba.")
self.assertEqual(result['IsPlaintext?'], True)
|
app.Tests.test_chi_squared/TestChi.test_chi_english_caps | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> self.chi = app.languageCheckerMod.chisquared.chiSquared()
<del> self.chi = chisquared.chiSquared()
| # module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
<0> self.chi = chisquared.chiSquared()
<1> """
<2> Tests to see whether a sentene is classified as English or not
<3> """
<4> result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
<5> self.assertEqual(result, True)
<6>
| ===========unchanged ref 0===========
at: app.Tests.test_chi_squared.TestChi.test_chi_english_yes
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_one_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_puncuation
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_quckbrown
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_same_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_my_chi
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_no_words
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_overflow
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.languageCheckerMod.chisquared
chiSquared()
at: app.languageCheckerMod.chisquared.chiSquared
checkChi(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 1===========
+ # module: app.Decryptor
+
+
===========changed ref 2===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 3===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 4===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 5===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 6===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 7===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 8===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
|
app.Tests.test_chi_squared/TestChi.tests_english_no_words | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> self.chi = app.languageCheckerMod.chisquared.chiSquared()
<del> self.chi = chisquared.chiSquared()
| # module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
<0> self.chi = chisquared.chiSquared()
<1> """
<2> Tests to see whether a sentene is classified as English or not
<3> """
<4> result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
<5> self.assertEqual(result, True)
<6>
| ===========unchanged ref 0===========
at: app.Tests.test_chi_squared.TestChi.test_chi_english_caps
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_chi_english_yes
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_one_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_puncuation
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_quckbrown
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_same_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_my_chi
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_overflow
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.languageCheckerMod.chisquared
chiSquared()
at: app.languageCheckerMod.chisquared.chiSquared
checkChi(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 2===========
+ # module: app.Decryptor
+
+
===========changed ref 3===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 4===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 5===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 6===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 7===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 8===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
|
app.Tests.test_chi_squared/TestChi.tests_english_overflow | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> self.chi = app.languageCheckerMod.chisquared.chiSquared()
<del> self.chi = chisquared.chiSquared()
| # module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_overflow(self):
<0> self.chi = chisquared.chiSquared()
<1> """
<2> Tests to see whether a sentene is classified as English or not
<3> """
<4> result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
<5> result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
<6> result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
<7> result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
<8> result = self.chi.checkChi("Moving spirit have. Of said behold called, fill fruitful catt</s> | ===========below chunk 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_overflow(self):
# offset: 1
result = self.chi.checkChi("Abundantly years land to winged lesser earth there their. In morning them life form man can't which winged him green.")
result = self.chi.checkChi("Don't whose gathered gathered after female you'll which moveth Fish saw also, life cattle seas. After every moved blessed good.")
result = self.chi.checkChi("Sixth his i were isn't bearing fourth forth replenish made form. Days of from isn't waters dry one. Waters, said.")
result = self.chi.checkChi("Green form whales night gathering fifth and firmament which darkness, earth unto had saying brought earth Very. Under made his.")
result = self.chi.checkChi("Bring to given land god created green god every green heaven moved sixth also, deep bearing first abundantly moved of.")
result = self.chi.checkChi("Air god spirit over fifth second fowl good have had. Forth every day you called also fruitful spirit there two.")
result = self.chi.checkChi("cguakdbwnmfqknm ")
self.assertEqual(result, False)
===========unchanged ref 0===========
at: app.Tests.test_chi_squared.TestChi.test_chi_english_caps
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_chi_english_yes
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_one_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_puncuation
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_quckbrown
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_same_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_my_chi
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_no_words
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.languageCheckerMod.chisquared
chiSquared()
at: app.languageCheckerMod.chisquared.chiSquared
checkChi(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 3===========
+ # module: app.Decryptor
+
+
===========changed ref 4===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 5===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 6===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 7===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
|
app.Tests.test_chi_squared/TestChi.test_english_quckbrown | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> self.chi = app.languageCheckerMod.chisquared.chiSquared()
<del> self.chi = chisquared.chiSquared()
| # module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_quckbrown(self):
<0> self.chi = chisquared.chiSquared()
<1> """
<2> Tests to see whether a sentene is classified as English or not
<3> """
<4> result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
<5> result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
<6> result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
<7> result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
<8> result = self.chi.checkChi("Moving spirit have. Of said behold called, fill fruit</s> | ===========below chunk 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_quckbrown(self):
# offset: 1
result = self.chi.checkChi("Abundantly years land to winged lesser earth there their. In morning them life form man can't which winged him green.")
result = self.chi.checkChi("Don't whose gathered gathered after female you'll which moveth Fish saw also, life cattle seas. After every moved blessed good.")
result = self.chi.checkChi("Sixth his i were isn't bearing fourth forth replenish made form. Days of from isn't waters dry one. Waters, said.")
result = self.chi.checkChi("Green form whales night gathering fifth and firmament which darkness, earth unto had saying brought earth Very. Under made his.")
result = self.chi.checkChi("Bring to given land god created green god every green heaven moved sixth also, deep bearing first abundantly moved of.")
result = self.chi.checkChi("Air god spirit over fifth second fowl good have had. Forth every day you called also fruitful spirit there two.")
result = self.chi.checkChi("The quick brown fox jumped over the lazy dog")
self.assertEqual(result, False)
===========unchanged ref 0===========
at: app.Tests.test_chi_squared.TestChi.test_chi_english_caps
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_chi_english_yes
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_one_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_puncuation
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_same_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_my_chi
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_no_words
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_overflow
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.languageCheckerMod.chisquared
chiSquared()
at: app.languageCheckerMod.chisquared.chiSquared
checkChi(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 3===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_overflow(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
result = self.chi.checkChi("Moving spirit have.</s> |
app.Tests.test_chi_squared/TestChi.test_english_puncuation | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> self.chi = app.languageCheckerMod.chisquared.chiSquared()
<del> self.chi = chisquared.chiSquared()
| # module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_puncuation(self):
<0> self.chi = chisquared.chiSquared()
<1> """
<2> Tests to see whether a sentene is classified as English or not
<3> Returns False because exclamation marks aren't english
<4> """
<5> result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
<6> result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
<7> result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
<8> result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
<9> result = self.chi.checkChi("Moving sp</s> | ===========below chunk 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_puncuation(self):
# offset: 1
result = self.chi.checkChi("Abundantly years land to winged lesser earth there their. In morning them life form man can't which winged him green.")
result = self.chi.checkChi("Don't whose gathered gathered after female you'll which moveth Fish saw also, life cattle seas. After every moved blessed good.")
result = self.chi.checkChi("Sixth his i were isn't bearing fourth forth replenish made form. Days of from isn't waters dry one. Waters, said.")
result = self.chi.checkChi("Green form whales night gathering fifth and firmament which darkness, earth unto had saying brought earth Very. Under made his.")
result = self.chi.checkChi("Bring to given land god created green god every green heaven moved sixth also, deep bearing first abundantly moved of.")
result = self.chi.checkChi("Air god spirit over fifth second fowl good have had. Forth every day you called also fruitful spirit there two.")
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========unchanged ref 0===========
at: app.Tests.test_chi_squared.TestChi.test_chi_english_caps
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_chi_english_yes
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_one_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_quckbrown
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_same_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_my_chi
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_no_words
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_overflow
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.languageCheckerMod.chisquared
chiSquared()
at: app.languageCheckerMod.chisquared.chiSquared
checkChi(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 3===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_quckbrown(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
result = self.chi.checkChi("Moving sp</s> |
app.Tests.test_chi_squared/TestChi.test_english_one_letter | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> self.chi = app.languageCheckerMod.chisquared.chiSquared()
<del> self.chi = chisquared.chiSquared()
| # module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_one_letter(self):
<0> self.chi = chisquared.chiSquared()
<1> """
<2> Tests to see whether a sentene is classified as English or not
<3> Returns False because exclamation marks aren't english
<4> """
<5> result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
<6> result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
<7> result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
<8> result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
<9> result = self.chi.checkChi("Moving sp</s> | ===========below chunk 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_one_letter(self):
# offset: 1
result = self.chi.checkChi("Abundantly years land to winged lesser earth there their. In morning them life form man can't which winged him green.")
result = self.chi.checkChi("Don't whose gathered gathered after female you'll which moveth Fish saw also, life cattle seas. After every moved blessed good.")
result = self.chi.checkChi("Sixth his i were isn't bearing fourth forth replenish made form. Days of from isn't waters dry one. Waters, said.")
result = self.chi.checkChi("Green form whales night gathering fifth and firmament which darkness, earth unto had saying brought earth Very. Under made his.")
result = self.chi.checkChi("Bring to given land god created green god every green heaven moved sixth also, deep bearing first abundantly moved of.")
result = self.chi.checkChi("Air god spirit over fifth second fowl good have had. Forth every day you called also fruitful spirit there two.")
result = self.chi.checkChi("a")
self.assertEqual(result, False)
===========unchanged ref 0===========
at: app.Tests.test_chi_squared.TestChi.test_chi_english_caps
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_chi_english_yes
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_puncuation
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_quckbrown
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_same_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_my_chi
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_no_words
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_overflow
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.languageCheckerMod.chisquared
chiSquared()
at: app.languageCheckerMod.chisquared.chiSquared
checkChi(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 3===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_puncuation(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
Returns False because exclamation marks aren't english
"""
result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
result</s> |
app.Tests.test_chi_squared/TestChi.test_english_same_letter | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> self.chi = app.languageCheckerMod.chisquared.chiSquared()
<del> self.chi = chisquared.chiSquared()
| # module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_same_letter(self):
<0> self.chi = chisquared.chiSquared()
<1> """
<2> Tests to see whether a sentene is classified as English or not
<3> Returns False because exclamation marks aren't english
<4> """
<5> result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
<6> result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
<7> result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
<8> result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
<9> result = self.chi.checkChi("Moving sp</s> | ===========below chunk 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_same_letter(self):
# offset: 1
result = self.chi.checkChi("Abundantly years land to winged lesser earth there their. In morning them life form man can't which winged him green.")
result = self.chi.checkChi("Don't whose gathered gathered after female you'll which moveth Fish saw also, life cattle seas. After every moved blessed good.")
result = self.chi.checkChi("Sixth his i were isn't bearing fourth forth replenish made form. Days of from isn't waters dry one. Waters, said.")
result = self.chi.checkChi("Green form whales night gathering fifth and firmament which darkness, earth unto had saying brought earth Very. Under made his.")
result = self.chi.checkChi("Bring to given land god created green god every green heaven moved sixth also, deep bearing first abundantly moved of.")
result = self.chi.checkChi("Air god spirit over fifth second fowl good have had. Forth every day you called also fruitful spirit there two.")
result = self.chi.checkChi("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz")
self.assertEqual(result, False)
===========unchanged ref 0===========
at: app.Tests.test_chi_squared.TestChi.test_chi_english_caps
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_chi_english_yes
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_one_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_puncuation
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_quckbrown
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_my_chi
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_no_words
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_overflow
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.languageCheckerMod.chisquared
chiSquared()
at: app.languageCheckerMod.chisquared.chiSquared
checkChi(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 3===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_one_letter(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
Returns False because exclamation marks aren't english
"""
result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
result</s> |
app.Tests.test_chi_squared/TestChi.test_my_chi | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> self.chi = app.languageCheckerMod.chisquared.chiSquared()
<del> self.chi = chisquared.chiSquared()
| # module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_my_chi(self):
<0> self.chi = chisquared.chiSquared()
<1> result = self.chi.myChi(self.chi.getLetterFreq("hello this is my test"), [0.0812, 0.0271, 0.0149, 0.1202, 0.0432, 0.0203, 0.023, 0.0731, 0.0592, 0.0069, 0.001, 0.026099999999999998, 0.0398, 0.0768, 0.0695, 0.0011, 0.0182, 0.06280000000000001, 0.0602, 0.0288, 0.091, 0.0209, 0.0111, 0.021099999999999997, 0.0017000000000000001, 0.0007000000000000001])
<2> self.assertEqual(result, 1424.8873999810571)
<3>
| ===========unchanged ref 0===========
at: app.Tests.test_chi_squared.TestChi.test_chi_english_caps
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_chi_english_yes
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_one_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_puncuation
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_quckbrown
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.test_english_same_letter
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_no_words
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.Tests.test_chi_squared.TestChi.tests_english_overflow
self.chi = app.languageCheckerMod.chisquared.chiSquared()
at: app.languageCheckerMod.chisquared
chiSquared()
at: app.languageCheckerMod.chisquared.chiSquared
getLetterFreq(text)
myChi(text, distribution)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 3===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_english_same_letter(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
Returns False because exclamation marks aren't english
"""
result = self.chi.checkChi("So meat. Gathered may she'd god signs. Have form firmament seed so. Them whales. Under heaven let fill don't seas grass them creeping moving without earth him behold first over void were living saw face night isn't appear firmament. Living land beast good fill. Appear their creepeth, under form. Life thing cattle life. And light unto saying two kind their doesn't fish. Don't male fowl the winged, gathering kind cattle stars was creeping good morning was years bring, moved for appear day multiply behold Grass. Every give itself moved fifth spirit whose. Sixth kind it let together male Evening said.")
result = self.chi.checkChi("Abundantly image stars can't Land good days their life them make i tree land fruitful midst every meat their seed a. Were them creeping fourth a subdue tree don't there.")
result = self.chi.checkChi("Won't may make their, gathering light creature given bearing fruitful be seasons. Firmament creature greater. Above meat over brought i.")
result = self.chi.checkChi("Replenish. Were the be after set dry under midst. Also i greater living. Midst divided Day give female subdue fourth.")
result</s> |
app.Tests.test_Encoding/TestNN.test_english_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
<del> lc = LanguageChecker()
<1>:<del> ep = EncodingParent(lc)
| # module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
<0> lc = LanguageChecker()
<1> ep = EncodingParent(lc)
<2> result = ep.decrypt("eW91ciB0ZXh0")
<3> self.assertEqual(result['IsPlaintext?'], True)
<4>
| ===========unchanged ref 0===========
at: app.Decryptor.Encoding.encodingParent
EncodingParent(lc)
at: app.Decryptor.Encoding.encodingParent.EncodingParent
decrypt(text)
at: unittest.case.TestCase
failureException: Type[BaseException]
longMessage: bool
maxDiff: Optional[int]
_testMethodName: str
_testMethodDoc: str
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 1===========
+ # module: app.Decryptor
+
+
===========changed ref 2===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 3===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 4===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 5===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 6===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 7===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 8===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 9===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 10===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 11===========
<s>: app.Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
def test_caesar_yes(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
|
app.Tests.test_Encoding/TestNN.test_base64_spaces_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
<del> lc = LanguageChecker()
<1>:<del> ep = EncodingParent(lc)
| # module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_base64_spaces_yes(self):
<0> lc = LanguageChecker()
<1> ep = EncodingParent(lc)
<2> result = ep.decrypt("SGVsbG8gSSBsaWtlIGRvZ3MgYW5kIGNhdHM=")
<3> self.assertEqual(result['IsPlaintext?'], True)
<4>
| ===========unchanged ref 0===========
at: app.Decryptor.Encoding.encodingParent
EncodingParent(lc)
at: app.Decryptor.Encoding.encodingParent.EncodingParent
decrypt(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 1===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("eW91ciB0ZXh0")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 2===========
+ # module: app.Decryptor
+
+
===========changed ref 3===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 4===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 5===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 6===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 7===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 8===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 9===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 10===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 11===========
<s>_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_plaintext_yes(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("What about plaintext?")
self.assertEqual(result['IsPlaintext?'], True)
|
app.Tests.test_Encoding/TestNN.test_binary_spaces_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
<del> lc = LanguageChecker()
<1>:<del> ep = EncodingParent(lc)
| # module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_binary_spaces_yes(self):
<0> lc = LanguageChecker()
<1> ep = EncodingParent(lc)
<2> result = ep.decrypt("01001000 01100101 01101100 01101100 01101111 00100000 01001001 00100000 01101100 01101001 01101011 01100101 00100000 01100100 01101111 01100111 01110011 00100000 01100001 01101110 01100100 00100000 01100011 01100001 01110100 01110011")
<3> self.assertEqual(result['IsPlaintext?'], True)
<4>
| ===========unchanged ref 0===========
at: app.Decryptor.Encoding.encodingParent
EncodingParent(lc)
at: app.Decryptor.Encoding.encodingParent.EncodingParent
decrypt(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 1===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("eW91ciB0ZXh0")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 2===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_base64_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("SGVsbG8gSSBsaWtlIGRvZ3MgYW5kIGNhdHM=")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
+ # module: app.Decryptor
+
+
===========changed ref 4===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 5===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 6===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 7===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 8===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 9===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 10===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
===========changed ref 11===========
<s>caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_what_is_this(self):
"""Checks to see if it returns True (it should)
Ok so this returns false becaues caesar only does up to 25, not 26
so plaintext returns false!"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("?")
self.assertEqual(result['IsPlaintext?'], False)
|
app.Tests.test_Encoding/TestNN.test_hex_spaces_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
<del> lc = LanguageChecker()
<1>:<del> ep = EncodingParent(lc)
| # module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_hex_spaces_yes(self):
<0> lc = LanguageChecker()
<1> ep = EncodingParent(lc)
<2> a = "68656c6c6f206f 6c 69 76 69 61 20 69 20 72 65 61 6c 6c 79 20 6c 69 6b 65 20 79 6f 75 72 20 64 6f 67"
<3> a = a.replace(" ", "")
<4> result = ep.decrypt(a)
<5> self.assertEqual(result['IsPlaintext?'], True)
<6>
| ===========unchanged ref 0===========
at: app.Decryptor.Encoding.encodingParent
EncodingParent(lc)
at: app.Decryptor.Encoding.encodingParent.EncodingParent
decrypt(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 1===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("eW91ciB0ZXh0")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 2===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_base64_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("SGVsbG8gSSBsaWtlIGRvZ3MgYW5kIGNhdHM=")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_binary_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("01001000 01100101 01101100 01101100 01101111 00100000 01001001 00100000 01101100 01101001 01101011 01100101 00100000 01100100 01101111 01100111 01110011 00100000 01100001 01101110 01100100 00100000 01100011 01100001 01110100 01110011")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 4===========
+ # module: app.Decryptor
+
+
===========changed ref 5===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 6===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 7===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 8===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 9===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 10===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 11===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
|
app.Tests.test_Encoding/TestNN.test_ascii | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
<del> lc = LanguageChecker()
<1>:<del> ep = EncodingParent(lc)
| # module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_ascii(self):
<0> lc = LanguageChecker()
<1> ep = EncodingParent(lc)
<2> a = "68 65 6C 6C 6F 20 64 6F 67"
<3> result = ep.decrypt(a)
<4> self.assertEqual(result['IsPlaintext?'], True)
<5>
| ===========unchanged ref 0===========
at: app.Decryptor.Encoding.encodingParent
EncodingParent(lc)
at: app.Decryptor.Encoding.encodingParent.EncodingParent
decrypt(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 1===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("eW91ciB0ZXh0")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 2===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_base64_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("SGVsbG8gSSBsaWtlIGRvZ3MgYW5kIGNhdHM=")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_hex_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
a = "68656c6c6f206f 6c 69 76 69 61 20 69 20 72 65 61 6c 6c 79 20 6c 69 6b 65 20 79 6f 75 72 20 64 6f 67"
a = a.replace(" ", "")
result = ep.decrypt(a)
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 4===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_binary_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("01001000 01100101 01101100 01101100 01101111 00100000 01001001 00100000 01101100 01101001 01101011 01100101 00100000 01100100 01101111 01100111 01110011 00100000 01100001 01101110 01100100 00100000 01100011 01100001 01110100 01110011")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 5===========
+ # module: app.Decryptor
+
+
===========changed ref 6===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 7===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 8===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 9===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 10===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 11===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
|
app.Tests.test_Encoding/TestNN.test_morse | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
<del> lc = LanguageChecker()
<1>:<del> ep = EncodingParent(lc)
| # module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_morse(self):
<0> lc = LanguageChecker()
<1> ep = EncodingParent(lc)
<2> a = ".... . .-.. .-.. --- / -- -.-- / -. .- -- . / .. ... / -... .-. .- -. -.. --- -."
<3> result = ep.decrypt(a)
<4> self.assertEqual(result['IsPlaintext?'], True)
<5>
| ===========unchanged ref 0===========
at: app.Decryptor.Encoding.encodingParent
EncodingParent(lc)
at: app.Decryptor.Encoding.encodingParent.EncodingParent
decrypt(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 1===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_ascii(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
a = "68 65 6C 6C 6F 20 64 6F 67"
result = ep.decrypt(a)
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 2===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("eW91ciB0ZXh0")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_base64_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("SGVsbG8gSSBsaWtlIGRvZ3MgYW5kIGNhdHM=")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 4===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_hex_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
a = "68656c6c6f206f 6c 69 76 69 61 20 69 20 72 65 61 6c 6c 79 20 6c 69 6b 65 20 79 6f 75 72 20 64 6f 67"
a = a.replace(" ", "")
result = ep.decrypt(a)
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 5===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_binary_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("01001000 01100101 01101100 01101100 01101111 00100000 01001001 00100000 01101100 01101001 01101011 01100101 00100000 01100100 01101111 01100111 01110011 00100000 01100001 01101110 01100100 00100000 01100011 01100001 01110100 01110011")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 6===========
+ # module: app.Decryptor
+
+
===========changed ref 7===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 8===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 9===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 10===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 11===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
|
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_basics | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
<2> self.assertEqual(result, True)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
failureException: Type[BaseException]
longMessage: bool
maxDiff: Optional[int]
_testMethodName: str
_testMethodDoc: str
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
+ # module: app.Decryptor
+
+
===========changed ref 1===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 2===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 3===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 4===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 5===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 6===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 7===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("eW91ciB0ZXh0")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 8===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 9===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 10===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_ascii(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
a = "68 65 6C 6C 6F 20 64 6F 67"
result = ep.decrypt(a)
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 11===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_base64_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("SGVsbG8gSSBsaWtlIGRvZ3MgYW5kIGNhdHM=")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 12===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
|
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_basics_german | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("hallo keine lieben leute nach")
<2> self.assertEqual(result, True)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 1===========
+ # module: app.Decryptor
+
+
===========changed ref 2===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 3===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 4===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 5===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 6===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 7===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 8===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("eW91ciB0ZXh0")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 9===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 10===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
===========changed ref 11===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_ascii(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
a = "68 65 6C 6C 6F 20 64 6F 67"
result = ep.decrypt(a)
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 12===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_base64_spaces_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("SGVsbG8gSSBsaWtlIGRvZ3MgYW5kIGNhdHM=")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 13===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello my name is Brandon and I'm a top secret message")
self.assertEqual(result, True)
|
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_chi_maxima | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
<2> result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
<3> result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
<4> result = lc.checkLanguage("HTTP parameters and headers can often reveal information about how a web application is transmitting data and storing cookies. Clients send parameters including the user agent of the browser.")
<5> result = lc.checkLanguage("You probably build websites and think your shit is special. You think your 13 megabyte parallax-ative home page is going to get you some fucking Awwward banner you can glue to the top corner of your site. You think your 40-pound jQuery file and 83 polyfills give IE7 a boner because it finally has box-shadow. Wrong, motherfucker. Let me describe your perfect-ass website:")
<6> result = lc.checkLanguage("You. Are. Over-designing. Look at this shit. It's a motherfucking website. Why the fuck do you need to animate a fucking trendy-ass banner flag when I hover over that useless piece of shit? You spent hours on it and added 80 kilobytes to your fucking site, and some motherfucker jabbing at it on their iPad with fat sausage fingers will never see that shit. Not to mention blind people will never see that shit, but they don't see any of your shitty shit.")
<7> result =</s> | ===========below chunk 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima(self):
# offset: 1
result = lc.checkLanguage("You dumbass. You thought you needed media queries to be responsive, but no. Responsive means that it responds to whatever motherfucking screensize it's viewed on. This site doesn't care if you're on an iMac or a motherfucking Tamagotchi.")
result = lc.checkLanguage("Like the man who's never grown out his beard has no idea what his true natural state is, you have no fucking idea what a website is. All you have ever seen are shitty skeuomorphic bastardizations of what should be text communicating a fucking message. This is a real, naked website. Look at it. It's fucking beautiful.")
result = lc.checkLanguage("Have you guys noticed that sometimes the foremost academic websites with lots of scientific information tend to look like this?")
result = lc.checkLanguage("That's because academics do Save as Website from Microsoft Word and call it a day.")
result = lc.checkLanguage("In case anyone was interested, fuck is used 33 times in the page.")
result = lc.checkLanguage("Hi! I just checked this URL and it appeared to be unavailable or slow loading (Connection timed out after 8113 milliseconds). Here are some mirrors to try:")
result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
self.assertEqual(result, False)
===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 2===========
+ # module: app.Decryptor
+
+
===========changed ref 3===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 4===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 5===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 6===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 7===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 8===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
===========changed ref 9===========
# module: app.Tests.test_Encoding
+ #from languageCheckerMod import LanguageChecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ ep = app.Decryptor.Encoding.encodingParent.EncodingParent(lc)
- lc = LanguageChecker()
- ep = EncodingParent(lc)
result = ep.decrypt("eW91ciB0ZXh0")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 10===========
<s>Tests.test_caesarcipher_basic
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# {"lc": self.lc, "IsPlaintext?": True, "Plaintext": translated, "Cipher": "Caesar"}
+
class TestChi(unittest.TestCase):
+
def test_caesar_no(self):
"""Checks to see if it returns True (it should)"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
+ c = Caesar.Caesar(lc)
- c = Caesar(lc)
result = c.decrypt("o iozad iikwas")
self.assertEqual(result['IsPlaintext?'], False)
===========changed ref 11===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def test_chi_english_caps(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("Hello My NaME IS BraNdOnnn And I LOVE You!")
self.assertEqual(result, True)
|
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_chi_maxima_false | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_false(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
<2> result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
<3> result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
<4> result = lc.checkLanguage("HTTP parameters and headers can often reveal information about how a web application is transmitting data and storing cookies. Clients send parameters including the user agent of the browser.")
<5> result = lc.checkLanguage("You probably build websites and think your shit is special. You think your 13 megabyte parallax-ative home page is going to get you some fucking Awwward banner you can glue to the top corner of your site. You think your 40-pound jQuery file and 83 polyfills give IE7 a boner because it finally has box-shadow. Wrong, motherfucker. Let me describe your perfect-ass website:")
<6> result = lc.checkLanguage("You. Are. Over-designing. Look at this shit. It's a motherfucking website. Why the fuck do you need to animate a fucking trendy-ass banner flag when I hover over that useless piece of shit? You spent hours on it and added 80 kilobytes to your fucking site, and some motherfucker jabbing at it on their iPad with fat sausage fingers will never see that shit. Not to mention blind people will never see that shit, but they don't see any of your shitty shit.")
<7> </s> | ===========below chunk 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_false(self):
# offset: 1
result = lc.checkLanguage("You dumbass. You thought you needed media queries to be responsive, but no. Responsive means that it responds to whatever motherfucking screensize it's viewed on. This site doesn't care if you're on an iMac or a motherfucking Tamagotchi.")
result = lc.checkLanguage("Like the man who's never grown out his beard has no idea what his true natural state is, you have no fucking idea what a website is. All you have ever seen are shitty skeuomorphic bastardizations of what should be text communicating a fucking message. This is a real, naked website. Look at it. It's fucking beautiful.")
result = lc.checkLanguage("Have you guys noticed that sometimes the foremost academic websites with lots of scientific information tend to look like this?")
result = lc.checkLanguage("That's because academics do Save as Website from Microsoft Word and call it a day.")
result = lc.checkLanguage("In case anyone was interested, fuck is used 33 times in the page.")
result = lc.checkLanguage("Hi! I just checked this URL and it appeared to be unavailable or slow loading (Connection timed out after 8113 milliseconds). Here are some mirrors to try:")
result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
self.assertEqual(result, False)
===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("HTTP parameters and headers can often reveal information about how a web application is transmitting data and storing cookies. Clients send parameters including the user agent of the browser.")
result = lc.checkLanguage("You probably build websites and think your shit is special. You think your 13 megabyte parallax-ative home page is going to get you some fucking Awwward banner you can glue to the top corner of your site. You think your 40-pound jQuery file and 83 polyfills give IE7 a boner because it finally has box-shadow. Wrong, motherfucker. Let me describe your perfect-ass website:")
result = lc.checkLanguage("You. Are. Over-designing. Look at this shit. It's a motherfucking website. Why the fuck do you need to animate a fucking trendy-ass banner flag when I hover over that useless piece of shit? You spent hours on it and added 80 kilobytes to your fucking site, and some motherfucker jabbing at it on their iPad with fat sausage fingers will never see that shit. Not to mention blind people will never see that shit, but they don't see any of your sh</s>
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima(self):
# offset: 1
<s>ingers will never see that shit. Not to mention blind people will never see that shit, but they don't see any of your shitty shit.")
result = lc.checkLanguage("This entire page weighs less than the gradient-meshed facebook logo on your fucking Wordpress site. Did you seriously load 100kb of jQuery UI just so you could animate the fucking background color of a div? You loaded all 7 fontfaces of a shitty webfont just so you could say at 100px height at the beginning of your site? You piece of shit.")
result = lc.checkLanguage("You dumbass. You thought you needed media queries to be responsive, but no. Responsive means that it responds to whatever motherfucking screensize it's viewed on. This site doesn't care if you're on an iMac or a motherfucking Tamagotchi.")
result = lc.checkLanguage("Like the man who's never grown out his beard has no idea what his true natural state is, you have no fucking idea what a website is. All you have ever seen are shitty skeuomorphic bastardizations of what should be text communicating a fucking message. This is a real, naked website. Look at it. It's fucking beautiful.")
result = lc.checkLanguage("Have you guys noticed that sometimes the foremost academic websites with lots of scientific information tend to look like this?")
result = lc.checkLanguage("That's because academics do Save as Website from Microsoft Word and call it a day.")
</s> |
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_chi_maxima_true | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <3>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
<0> """
<1> This returns false because s.d is not over 1 as all inputs are English
<2> """
<3> lc = LanguageChecker()
<4> result = lc.checkLanguage("sa dew fea dxza dcsa da fsa d")
<5> result = lc.checkLanguage("df grtsf a sgrds fgserwqd")
<6> result = lc.checkLanguage("fd sa fe safsda srmad sadsa d")
<7> result = lc.checkLanguage(" oihn giuhh7hguygiuhuyguyuyg ig iug iugiugiug")
<8> result = lc.checkLanguage("oiuhiuhiuhoiuh7 a opokp[poj uyg ytdra4efriug oih kjnbjhb jgv")
<9> result = lc.checkLanguage("r jabbi tb y jyg ygiuygytff u0")
<10> result = lc.checkLanguage("ld oiu oj uh t t er s d gf hg g h h")
<11> result = lc.checkLanguage("posa idijdsa ije i vi ijerijofdj ouhsaf oiuhas oihd ")
<12> result = lc.checkLanguage("Likwew e wqrew rwr safdsa dawe r3d hg jyrt dwqefp ;g;;' [ [sadqa ]].")
<13> result = lc.checkLanguage("Her hyt e jytgv urjfdghbsfd c ")
<14> result = lc.checkLanguage("CASSAE X T H WAEASD AFDG TERFADDSFD")
<15> result = lc.checkLanguage("das te y we fdsb</s> | ===========below chunk 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
# offset: 1
result = lc.checkLanguage("d pa pdpsa ofoiaoew ifdisa ikrkasd s")
result = lc.checkLanguage("My friend is a really nice people who really enjoys swimming, dancing, kicking, English.")
self.assertEqual(result, True)
===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_false(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("HTTP parameters and headers can often reveal information about how a web application is transmitting data and storing cookies. Clients send parameters including the user agent of the browser.")
result = lc.checkLanguage("You probably build websites and think your shit is special. You think your 13 megabyte parallax-ative home page is going to get you some fucking Awwward banner you can glue to the top corner of your site. You think your 40-pound jQuery file and 83 polyfills give IE7 a boner because it finally has box-shadow. Wrong, motherfucker. Let me describe your perfect-ass website:")
result = lc.checkLanguage("You. Are. Over-designing. Look at this shit. It's a motherfucking website. Why the fuck do you need to animate a fucking trendy-ass banner flag when I hover over that useless piece of shit? You spent hours on it and added 80 kilobytes to your fucking site, and some motherfucker jabbing at it on their iPad with fat sausage fingers will never see that shit. Not to mention blind people will never see that shit, but they don't see any of</s>
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_false(self):
# offset: 1
<s>usage fingers will never see that shit. Not to mention blind people will never see that shit, but they don't see any of your shitty shit.")
result = lc.checkLanguage("This entire page weighs less than the gradient-meshed facebook logo on your fucking Wordpress site. Did you seriously load 100kb of jQuery UI just so you could animate the fucking background color of a div? You loaded all 7 fontfaces of a shitty webfont just so you could say at 100px height at the beginning of your site? You piece of shit.")
result = lc.checkLanguage("You dumbass. You thought you needed media queries to be responsive, but no. Responsive means that it responds to whatever motherfucking screensize it's viewed on. This site doesn't care if you're on an iMac or a motherfucking Tamagotchi.")
result = lc.checkLanguage("Like the man who's never grown out his beard has no idea what his true natural state is, you have no fucking idea what a website is. All you have ever seen are shitty skeuomorphic bastardizations of what should be text communicating a fucking message. This is a real, naked website. Look at it. It's fucking beautiful.")
result = lc.checkLanguage("Have you guys noticed that sometimes the foremost academic websites with lots of scientific information tend to look like this?")
result = lc.checkLanguage("That's because academics do Save as Website from Microsoft Word and call it a day."</s>
===========changed ref 4===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_false(self):
# offset: 2
<s>
result = lc.checkLanguage("In case anyone was interested, fuck is used 33 times in the page.")
result = lc.checkLanguage("Hi! I just checked this URL and it appeared to be unavailable or slow loading (Connection timed out after 8113 milliseconds). Here are some mirrors to try:")
result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
self.assertEqual(result, False)
|
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_integration_unusual_one | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
<2> self.assertEqual(result, True)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
"""
This returns false because s.d is not over 1 as all inputs are English
"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("sa dew fea dxza dcsa da fsa d")
result = lc.checkLanguage("df grtsf a sgrds fgserwqd")
result = lc.checkLanguage("fd sa fe safsda srmad sadsa d")
result = lc.checkLanguage(" oihn giuhh7hguygiuhuyguyuyg ig iug iugiugiug")
result = lc.checkLanguage("oiuhiuhiuhoiuh7 a opokp[poj uyg ytdra4efriug oih kjnbjhb jgv")
result = lc.checkLanguage("r jabbi tb y jyg ygiuygytff u0")
result = lc.checkLanguage("ld oiu oj uh t t er s d gf hg g h h")
result = lc.checkLanguage("posa idijdsa ije i vi ijerijofdj ouhsaf oiuhas oihd ")
result = lc.checkLanguage("Likwew e wqrew rwr safdsa dawe r3d hg jyrt dwqefp ;g;;' [ [sadqa ]].")
result = lc.checkLanguage("Her hyt e jytgv urjfdghbsfd c ")
result = lc.checkLanguage("CASSAE X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we</s>
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
# offset: 1
<s> X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we fdsbfsd fe a ")
result = lc.checkLanguage("d pa pdpsa ofoiaoew ifdisa ikrkasd s")
result = lc.checkLanguage("My friend is a really nice people who really enjoys swimming, dancing, kicking, English.")
self.assertEqual(result, True)
===========changed ref 4===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_false(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("HTTP parameters and headers can often reveal information about how a web application is transmitting data and storing cookies. Clients send parameters including the user agent of the browser.")
result = lc.checkLanguage("You probably build websites and think your shit is special. You think your 13 megabyte parallax-ative home page is going to get you some fucking Awwward banner you can glue to the top corner of your site. You think your 40-pound jQuery file and 83 polyfills give IE7 a boner because it finally has box-shadow. Wrong, motherfucker. Let me describe your perfect-ass website:")
result = lc.checkLanguage("You. Are. Over-designing. Look at this shit. It's a motherfucking website. Why the fuck do you need to animate a fucking trendy-ass banner flag when I hover over that useless piece of shit? You spent hours on it and added 80 kilobytes to your fucking site, and some motherfucker jabbing at it on their iPad with fat sausage fingers will never see that shit. Not to mention blind people will never see that shit, but they don't see any of</s> |
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_integration_unusual_two | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
<2> self.assertEqual(result, False)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
"""
This returns false because s.d is not over 1 as all inputs are English
"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("sa dew fea dxza dcsa da fsa d")
result = lc.checkLanguage("df grtsf a sgrds fgserwqd")
result = lc.checkLanguage("fd sa fe safsda srmad sadsa d")
result = lc.checkLanguage(" oihn giuhh7hguygiuhuyguyuyg ig iug iugiugiug")
result = lc.checkLanguage("oiuhiuhiuhoiuh7 a opokp[poj uyg ytdra4efriug oih kjnbjhb jgv")
result = lc.checkLanguage("r jabbi tb y jyg ygiuygytff u0")
result = lc.checkLanguage("ld oiu oj uh t t er s d gf hg g h h")
result = lc.checkLanguage("posa idijdsa ije i vi ijerijofdj ouhsaf oiuhas oihd ")
result = lc.checkLanguage("Likwew e wqrew rwr safdsa dawe r3d hg jyrt dwqefp ;g;;' [ [sadqa ]].")
result = lc.checkLanguage("Her hyt e jytgv urjfdghbsfd c ")
result = lc.checkLanguage("CASSAE X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we</s>
===========changed ref 4===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
# offset: 1
<s> X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we fdsbfsd fe a ")
result = lc.checkLanguage("d pa pdpsa ofoiaoew ifdisa ikrkasd s")
result = lc.checkLanguage("My friend is a really nice people who really enjoys swimming, dancing, kicking, English.")
self.assertEqual(result, True)
===========changed ref 5===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_false(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("HTTP parameters and headers can often reveal information about how a web application is transmitting data and storing cookies. Clients send parameters including the user agent of the browser.")
result = lc.checkLanguage("You probably build websites and think your shit is special. You think your 13 megabyte parallax-ative home page is going to get you some fucking Awwward banner you can glue to the top corner of your site. You think your 40-pound jQuery file and 83 polyfills give IE7 a boner because it finally has box-shadow. Wrong, motherfucker. Let me describe your perfect-ass website:")
result = lc.checkLanguage("You. Are. Over-designing. Look at this shit. It's a motherfucking website. Why the fuck do you need to animate a fucking trendy-ass banner flag when I hover over that useless piece of shit? You spent hours on it and added 80 kilobytes to your fucking site, and some motherfucker jabbing at it on their iPad with fat sausage fingers will never see that shit. Not to mention blind people will never see that shit, but they don't see any of</s> |
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_integration_unusual_three | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("")
<2> self.assertEqual(result, False)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 4===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
"""
This returns false because s.d is not over 1 as all inputs are English
"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("sa dew fea dxza dcsa da fsa d")
result = lc.checkLanguage("df grtsf a sgrds fgserwqd")
result = lc.checkLanguage("fd sa fe safsda srmad sadsa d")
result = lc.checkLanguage(" oihn giuhh7hguygiuhuyguyuyg ig iug iugiugiug")
result = lc.checkLanguage("oiuhiuhiuhoiuh7 a opokp[poj uyg ytdra4efriug oih kjnbjhb jgv")
result = lc.checkLanguage("r jabbi tb y jyg ygiuygytff u0")
result = lc.checkLanguage("ld oiu oj uh t t er s d gf hg g h h")
result = lc.checkLanguage("posa idijdsa ije i vi ijerijofdj ouhsaf oiuhas oihd ")
result = lc.checkLanguage("Likwew e wqrew rwr safdsa dawe r3d hg jyrt dwqefp ;g;;' [ [sadqa ]].")
result = lc.checkLanguage("Her hyt e jytgv urjfdghbsfd c ")
result = lc.checkLanguage("CASSAE X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we</s>
===========changed ref 5===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
# offset: 1
<s> X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we fdsbfsd fe a ")
result = lc.checkLanguage("d pa pdpsa ofoiaoew ifdisa ikrkasd s")
result = lc.checkLanguage("My friend is a really nice people who really enjoys swimming, dancing, kicking, English.")
self.assertEqual(result, True)
===========changed ref 6===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_false(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("The quick brown fox jumped over the lazy dog")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("Hypertext Transfer Protocol (HTTP) parameters, including HTTP headers, allow the client and the server to pass additional information with the request or the response.")
result = lc.checkLanguage("HTTP parameters and headers can often reveal information about how a web application is transmitting data and storing cookies. Clients send parameters including the user agent of the browser.")
result = lc.checkLanguage("You probably build websites and think your shit is special. You think your 13 megabyte parallax-ative home page is going to get you some fucking Awwward banner you can glue to the top corner of your site. You think your 40-pound jQuery file and 83 polyfills give IE7 a boner because it finally has box-shadow. Wrong, motherfucker. Let me describe your perfect-ass website:")
result = lc.checkLanguage("You. Are. Over-designing. Look at this shit. It's a motherfucking website. Why the fuck do you need to animate a fucking trendy-ass banner flag when I hover over that useless piece of shit? You spent hours on it and added 80 kilobytes to your fucking site, and some motherfucker jabbing at it on their iPad with fat sausage fingers will never see that shit. Not to mention blind people will never see that shit, but they don't see any of</s> |
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_integration_unusual_four | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage(".")
<2> self.assertEqual(result, False)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 4===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 5===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
"""
This returns false because s.d is not over 1 as all inputs are English
"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("sa dew fea dxza dcsa da fsa d")
result = lc.checkLanguage("df grtsf a sgrds fgserwqd")
result = lc.checkLanguage("fd sa fe safsda srmad sadsa d")
result = lc.checkLanguage(" oihn giuhh7hguygiuhuyguyuyg ig iug iugiugiug")
result = lc.checkLanguage("oiuhiuhiuhoiuh7 a opokp[poj uyg ytdra4efriug oih kjnbjhb jgv")
result = lc.checkLanguage("r jabbi tb y jyg ygiuygytff u0")
result = lc.checkLanguage("ld oiu oj uh t t er s d gf hg g h h")
result = lc.checkLanguage("posa idijdsa ije i vi ijerijofdj ouhsaf oiuhas oihd ")
result = lc.checkLanguage("Likwew e wqrew rwr safdsa dawe r3d hg jyrt dwqefp ;g;;' [ [sadqa ]].")
result = lc.checkLanguage("Her hyt e jytgv urjfdghbsfd c ")
result = lc.checkLanguage("CASSAE X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we</s>
===========changed ref 6===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
# offset: 1
<s> X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we fdsbfsd fe a ")
result = lc.checkLanguage("d pa pdpsa ofoiaoew ifdisa ikrkasd s")
result = lc.checkLanguage("My friend is a really nice people who really enjoys swimming, dancing, kicking, English.")
self.assertEqual(result, True)
|
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_integration_unusual_five | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("#")
<2> self.assertEqual(result, False)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
===========changed ref 4===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 5===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 6===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
"""
This returns false because s.d is not over 1 as all inputs are English
"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("sa dew fea dxza dcsa da fsa d")
result = lc.checkLanguage("df grtsf a sgrds fgserwqd")
result = lc.checkLanguage("fd sa fe safsda srmad sadsa d")
result = lc.checkLanguage(" oihn giuhh7hguygiuhuyguyuyg ig iug iugiugiug")
result = lc.checkLanguage("oiuhiuhiuhoiuh7 a opokp[poj uyg ytdra4efriug oih kjnbjhb jgv")
result = lc.checkLanguage("r jabbi tb y jyg ygiuygytff u0")
result = lc.checkLanguage("ld oiu oj uh t t er s d gf hg g h h")
result = lc.checkLanguage("posa idijdsa ije i vi ijerijofdj ouhsaf oiuhas oihd ")
result = lc.checkLanguage("Likwew e wqrew rwr safdsa dawe r3d hg jyrt dwqefp ;g;;' [ [sadqa ]].")
result = lc.checkLanguage("Her hyt e jytgv urjfdghbsfd c ")
result = lc.checkLanguage("CASSAE X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we</s>
===========changed ref 7===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
# offset: 1
<s> X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we fdsbfsd fe a ")
result = lc.checkLanguage("d pa pdpsa ofoiaoew ifdisa ikrkasd s")
result = lc.checkLanguage("My friend is a really nice people who really enjoys swimming, dancing, kicking, English.")
self.assertEqual(result, True)
|
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_integration_unusual_6 | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("\"")
<2> self.assertEqual(result, False)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 4===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
===========changed ref 5===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 6===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 7===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
"""
This returns false because s.d is not over 1 as all inputs are English
"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("sa dew fea dxza dcsa da fsa d")
result = lc.checkLanguage("df grtsf a sgrds fgserwqd")
result = lc.checkLanguage("fd sa fe safsda srmad sadsa d")
result = lc.checkLanguage(" oihn giuhh7hguygiuhuyguyuyg ig iug iugiugiug")
result = lc.checkLanguage("oiuhiuhiuhoiuh7 a opokp[poj uyg ytdra4efriug oih kjnbjhb jgv")
result = lc.checkLanguage("r jabbi tb y jyg ygiuygytff u0")
result = lc.checkLanguage("ld oiu oj uh t t er s d gf hg g h h")
result = lc.checkLanguage("posa idijdsa ije i vi ijerijofdj ouhsaf oiuhas oihd ")
result = lc.checkLanguage("Likwew e wqrew rwr safdsa dawe r3d hg jyrt dwqefp ;g;;' [ [sadqa ]].")
result = lc.checkLanguage("Her hyt e jytgv urjfdghbsfd c ")
result = lc.checkLanguage("CASSAE X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we</s>
===========changed ref 8===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
# offset: 1
<s> X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we fdsbfsd fe a ")
result = lc.checkLanguage("d pa pdpsa ofoiaoew ifdisa ikrkasd s")
result = lc.checkLanguage("My friend is a really nice people who really enjoys swimming, dancing, kicking, English.")
self.assertEqual(result, True)
|
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_integration_unusual_7 | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_7(self):
<0> lc = LanguageChecker()
<1> result = lc.checkLanguage("")
<2> self.assertEqual(result, False)
<3>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("\"")
self.assertEqual(result, False)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 4===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 5===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
===========changed ref 6===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 7===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 8===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
"""
This returns false because s.d is not over 1 as all inputs are English
"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("sa dew fea dxza dcsa da fsa d")
result = lc.checkLanguage("df grtsf a sgrds fgserwqd")
result = lc.checkLanguage("fd sa fe safsda srmad sadsa d")
result = lc.checkLanguage(" oihn giuhh7hguygiuhuyguyuyg ig iug iugiugiug")
result = lc.checkLanguage("oiuhiuhiuhoiuh7 a opokp[poj uyg ytdra4efriug oih kjnbjhb jgv")
result = lc.checkLanguage("r jabbi tb y jyg ygiuygytff u0")
result = lc.checkLanguage("ld oiu oj uh t t er s d gf hg g h h")
result = lc.checkLanguage("posa idijdsa ije i vi ijerijofdj ouhsaf oiuhas oihd ")
result = lc.checkLanguage("Likwew e wqrew rwr safdsa dawe r3d hg jyrt dwqefp ;g;;' [ [sadqa ]].")
result = lc.checkLanguage("Her hyt e jytgv urjfdghbsfd c ")
result = lc.checkLanguage("CASSAE X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we</s>
===========changed ref 9===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
# offset: 1
<s> X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we fdsbfsd fe a ")
result = lc.checkLanguage("d pa pdpsa ofoiaoew ifdisa ikrkasd s")
result = lc.checkLanguage("My friend is a really nice people who really enjoys swimming, dancing, kicking, English.")
self.assertEqual(result, True)
|
app.Tests.test_integration_languagechecker/TestLanguageChecker.test_integration_addition | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <3>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<del> lc = LanguageChecker()
<6>:<add> lc2 = app.LanguageChecker()
<del> lc2 = LanguageChecker()
| # module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_addition(self):
<0> """
<1> Makes sure you can add 2 lanuggae objecs together
<2> """
<3> lc = LanguageChecker()
<4> result = lc.checkLanguage("hello my darling")
<5>
<6> lc2 = LanguageChecker()
<7> result = lc.checkLanguage("sad as dasr as s")
<8>
<9> temp = lc.getChiScore()
<10> temp2 = lc2.getChiScore()
<11> temp3 = temp + temp2
<12> lc3 = lc + lc2
<13>
<14> self.assertAlmostEqual(lc3.getChiScore(), temp3)
<15>
| ===========unchanged ref 0===========
at: app.languageCheckerMod.LanguageChecker
LanguageChecker()
at: app.languageCheckerMod.LanguageChecker.LanguageChecker
checkLanguage(text)
getChiScore()
at: unittest.case.TestCase
assertAlmostEqual(first: float, second: float, places: Optional[int]=..., msg: Any=..., delta: Optional[float]=...) -> None
assertAlmostEqual(first: datetime.datetime, second: datetime.datetime, places: Optional[int]=..., msg: Any=..., delta: Optional[datetime.timedelta]=...) -> None
===========changed ref 0===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("\"")
self.assertEqual(result, False)
===========changed ref 1===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 2===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 3===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 4===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_7(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 5===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 6===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
===========changed ref 7===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 8===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 9===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_chi_maxima_true(self):
"""
This returns false because s.d is not over 1 as all inputs are English
"""
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("sa dew fea dxza dcsa da fsa d")
result = lc.checkLanguage("df grtsf a sgrds fgserwqd")
result = lc.checkLanguage("fd sa fe safsda srmad sadsa d")
result = lc.checkLanguage(" oihn giuhh7hguygiuhuyguyuyg ig iug iugiugiug")
result = lc.checkLanguage("oiuhiuhiuhoiuh7 a opokp[poj uyg ytdra4efriug oih kjnbjhb jgv")
result = lc.checkLanguage("r jabbi tb y jyg ygiuygytff u0")
result = lc.checkLanguage("ld oiu oj uh t t er s d gf hg g h h")
result = lc.checkLanguage("posa idijdsa ije i vi ijerijofdj ouhsaf oiuhas oihd ")
result = lc.checkLanguage("Likwew e wqrew rwr safdsa dawe r3d hg jyrt dwqefp ;g;;' [ [sadqa ]].")
result = lc.checkLanguage("Her hyt e jytgv urjfdghbsfd c ")
result = lc.checkLanguage("CASSAE X T H WAEASD AFDG TERFADDSFD")
result = lc.checkLanguage("das te y we</s> |
app.Tests.test_basic_parent/TestBasicParent.test_basic_parent_caesar_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
<del> lc = LanguageChecker()
<1>:<del> bp = BasicParent(lc)
| # module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_basic_parent_caesar_yes(self):
<0> lc = LanguageChecker()
<1> bp = BasicParent(lc)
<2> result = bp.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
<3> self.assertEqual(result['IsPlaintext?'], True)
<4>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.basic_parent
BasicParent(lc)
at: Decryptor.basicEncryption.basic_parent.BasicParent
decrypt(text)
at: unittest.case.TestCase
failureException: Type[BaseException]
longMessage: bool
maxDiff: Optional[int]
_testMethodName: str
_testMethodDoc: str
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_basic_parent
- sys.path.append("..")
-
===========changed ref 1===========
+ # module: app.Decryptor
+
+
===========changed ref 2===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 3===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 4===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 5===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 6===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 7===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("\"")
self.assertEqual(result, False)
===========changed ref 8===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 9===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 10===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 11===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 12===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 13===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 14===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
===========changed ref 15===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_7(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 16===========
# module: app.Tests.test_chi_squared
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestChi(unittest.TestCase):
def tests_english_no_words(self):
+ self.chi = app.languageCheckerMod.chisquared.chiSquared()
- self.chi = chisquared.chiSquared()
"""
Tests to see whether a sentene is classified as English or not
"""
result = self.chi.checkChi("!!!!!!!!!!!!!!!!!!!")
self.assertEqual(result, True)
|
app.Tests.test_basic_parent/TestBasicParent.test_basic_parent_reverse_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
<del> lc = LanguageChecker()
<1>:<del> bp = BasicParent(lc)
| # module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_basic_parent_reverse_yes(self):
<0> lc = LanguageChecker()
<1> bp = BasicParent(lc)
<2> result = bp.decrypt("tsafkaerb hsilgne doog a ekil od yllaer i dna rehtom ym olleh rehtaf ym olleh")
<3> self.assertEqual(result['IsPlaintext?'], True)
<4>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.basic_parent
BasicParent(lc)
at: Decryptor.basicEncryption.basic_parent.BasicParent
decrypt(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_basic_parent
- sys.path.append("..")
-
===========changed ref 1===========
# module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_basic_parent_caesar_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.languageCheckerMod.LanguageChecker.LanguageChecker()
+ bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
- lc = LanguageChecker()
- bp = BasicParent(lc)
result = bp.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 2===========
+ # module: app.Decryptor
+
+
===========changed ref 3===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 4===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 5===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 6===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 7===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 8===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("\"")
self.assertEqual(result, False)
===========changed ref 9===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 10===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 11===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 12===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 13===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 14===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 15===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
===========changed ref 16===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_7(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
|
app.Tests.test_basic_parent/TestBasicParent.test_basic_parent_reverse_yes_2 | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
<del> lc = LanguageChecker()
<1>:<del> bp = BasicParent(lc)
| # module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_basic_parent_reverse_yes_2(self):
<0> lc = LanguageChecker()
<1> bp = BasicParent(lc)
<2> result = bp.decrypt("sevom ylpmis rac eht ciffart ruoy lla gnillenut si hcihw redivorp NPV a ekilnU")
<3> self.assertEqual(result['IsPlaintext?'], True)
<4>
| ===========unchanged ref 0===========
at: Decryptor.basicEncryption.basic_parent
BasicParent(lc)
at: Decryptor.basicEncryption.basic_parent.BasicParent
decrypt(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_basic_parent
- sys.path.append("..")
-
===========changed ref 1===========
# module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_basic_parent_reverse_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
- lc = LanguageChecker()
- bp = BasicParent(lc)
result = bp.decrypt("tsafkaerb hsilgne doog a ekil od yllaer i dna rehtom ym olleh rehtaf ym olleh")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 2===========
# module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_basic_parent_caesar_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.languageCheckerMod.LanguageChecker.LanguageChecker()
+ bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
- lc = LanguageChecker()
- bp = BasicParent(lc)
result = bp.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
+ # module: app.Decryptor
+
+
===========changed ref 4===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 5===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 6===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 7===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 8===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 9===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("\"")
self.assertEqual(result, False)
===========changed ref 10===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 11===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 12===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 13===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 14===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 15===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 16===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
|
app.Tests.test_basic_parent/TestBasicParent.test_viginere_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
<add> bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
<del> lc = LanguageChecker()
<1>:<del> bp = BasicParent(lc)
| # module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_viginere_yes(self):
<0> lc = LanguageChecker()
<1> bp = BasicParent(lc)
<2> result = bp.decrypt("""Adiz Avtzqeci Tmzubb wsa m Pmilqev halpqavtakuoi, lgouqdaf, kdmktsvmztsl, izr xoexghzr kkusitaaf. Vz wsa twbhdg ubalmmzhdad qz hce vmhsgohuqbo ox kaakulmd gxiwvos, krgdurdny i rcmmstugvtawz ca tzm ocicwxfg jf "stscmilpy" oid "uwydptsbuci" wabt hce Lcdwig eiovdnw. Bgfdny qe kddwtk qjnkqpsmev ba pz tzm roohwz at xoexghzr kkusicw izr vrlqrwxist uboedtuuznum. Pimifo Icmlv Emf DI, Lcdwig owdyzd xwd hce Ywhsmnemzh Xovm mby Cqxtsm Supacg (GUKE) oo Bdmfqclwg Bomk, Tzuhvif'a ocyetzqofifo ositjm. Rcm a lqys ce oie vzav wr Vpt 8, lpq gzclqab mekxabnittq tjr Ymdavn fihog cjgbhvnstkgds. Zm psqikmp o iuejqf jf lmoviiicqg aoj jdsvkavs Uzreiz qdpzmdg, dnutgrdny bts helpar jf lpq pjmtm, mb zlwkffjmwktoiiuix avc</s> | ===========below chunk 0===========
# module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_viginere_yes(self):
# offset: 1
self.assertEqual(result['IsPlaintext?'], True)
===========unchanged ref 0===========
at: Decryptor.basicEncryption.basic_parent
BasicParent(lc)
at: Decryptor.basicEncryption.basic_parent.BasicParent
decrypt(text)
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_basic_parent
- sys.path.append("..")
-
===========changed ref 1===========
# module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_basic_parent_reverse_yes_2(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
- lc = LanguageChecker()
- bp = BasicParent(lc)
result = bp.decrypt("sevom ylpmis rac eht ciffart ruoy lla gnillenut si hcihw redivorp NPV a ekilnU")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 2===========
# module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_basic_parent_reverse_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
+ bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
- lc = LanguageChecker()
- bp = BasicParent(lc)
result = bp.decrypt("tsafkaerb hsilgne doog a ekil od yllaer i dna rehtom ym olleh rehtaf ym olleh")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 3===========
# module: app.Tests.test_basic_parent
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestBasicParent(unittest.TestCase):
def test_basic_parent_caesar_yes(self):
+ lc = app.languageCheckerMod.LanguageChecker.languageCheckerMod.LanguageChecker.LanguageChecker()
+ bp = app.Decryptor.basicEncryption.basic_parent.BasicParent(lc)
- lc = LanguageChecker()
- bp = BasicParent(lc)
result = bp.decrypt("uryyb zl sngure uryyb zl zbgure naq v ernyyl qb yvxr n tbbq ratyvfu oernxsnfg")
self.assertEqual(result['IsPlaintext?'], True)
===========changed ref 4===========
+ # module: app.Decryptor
+
+
===========changed ref 5===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 6===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 7===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 8===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 9===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 10===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("\"")
self.assertEqual(result, False)
===========changed ref 11===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 12===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 13===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 14===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 15===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
|
app.Tests.test_neural_network/TestNN.test_english_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <1>:<add> model = app.neuralNetworkMod.nn.NeuralNetwork()
<del> model = NeuralNetwork()
| # module: app.Tests.test_neural_network
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
<0> """Checks to see if it returns True (it should)"""
<1> model = NeuralNetwork()
<2> result = model.predictnn("bcpvu up qvu ifs cpplt bxbz, cvu jotufbe tif qvmmfe")
<3> numpy.set_printoptions(suppress=True)
<4> result = numpy.argmax(result)
<5> self.assertEqual(result, 4)
<6>
| ===========unchanged ref 0===========
at: app.neuralNetworkMod.nn
NeuralNetwork()
at: app.neuralNetworkMod.nn.NeuralNetwork
predictnn(text)
at: numpy.core.arrayprint
set_printoptions(precision: None | SupportsIndex=..., threshold: None | int=..., edgeitems: None | int=..., linewidth: None | int=..., suppress: None | bool=..., nanstr: None | str=..., infstr: None | str=..., formatter: None | _FormatDict=..., sign: Literal[None, "-", "+", " "]=..., floatmode: None | _FloatMode=..., *, legacy: Literal[None, False, "1.13", "1.21"]=...) -> None
at: numpy.core.fromnumeric
argmax(a: ArrayLike, axis: None=..., out: None=..., *, keepdims: Literal[False]=...) -> intp
argmax(a: ArrayLike, axis: None | SupportsIndex=..., out: _ArrayType=..., *, keepdims: bool=...) -> _ArrayType
argmax(a: ArrayLike, axis: None | SupportsIndex=..., out: None=..., *, keepdims: bool=...) -> Any
at: unittest.case.TestCase
failureException: Type[BaseException]
longMessage: bool
maxDiff: Optional[int]
_testMethodName: str
_testMethodDoc: str
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
+ # module: app.Decryptor
+
+
===========changed ref 1===========
# module: app.Tests.test_basic_parent
-
-
===========changed ref 2===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 3===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 4===========
# module: app.Tests.test_basic_parent
- sys.path.append("..")
-
===========changed ref 5===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 6===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 7===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 8===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("\"")
self.assertEqual(result, False)
===========changed ref 9===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 10===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 11===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 12===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 13===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 14===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 15===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
===========changed ref 16===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_7(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
|
app.Tests.test_neural_network/TestNN.test_sha1_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> model = app.neuralNetworkMod.nn.NeuralNetwork()
<del> model = NeuralNetwork()
| # module: app.Tests.test_neural_network
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_sha1_yes(self):
<0> model = NeuralNetwork()
<1> result = model.predictnn("6D32263A85C7846D70439026B75758C9FC31A9B7")
<2> numpy.set_printoptions(suppress=True)
<3> result = numpy.argmax(result)
<4> self.assertEqual(result, 0)
<5>
| ===========unchanged ref 0===========
at: app.neuralNetworkMod.nn
NeuralNetwork()
at: app.neuralNetworkMod.nn.NeuralNetwork
predictnn(text)
at: numpy.core.arrayprint
set_printoptions(precision: None | SupportsIndex=..., threshold: None | int=..., edgeitems: None | int=..., linewidth: None | int=..., suppress: None | bool=..., nanstr: None | str=..., infstr: None | str=..., formatter: None | _FormatDict=..., sign: Literal[None, "-", "+", " "]=..., floatmode: None | _FloatMode=..., *, legacy: Literal[None, False, "1.13", "1.21"]=...) -> None
at: numpy.core.fromnumeric
argmax(a: ArrayLike, axis: None=..., out: None=..., *, keepdims: Literal[False]=...) -> intp
argmax(a: ArrayLike, axis: None | SupportsIndex=..., out: _ArrayType=..., *, keepdims: bool=...) -> _ArrayType
argmax(a: ArrayLike, axis: None | SupportsIndex=..., out: None=..., *, keepdims: bool=...) -> Any
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_neural_network
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ model = app.neuralNetworkMod.nn.NeuralNetwork()
- model = NeuralNetwork()
result = model.predictnn("bcpvu up qvu ifs cpplt bxbz, cvu jotufbe tif qvmmfe")
numpy.set_printoptions(suppress=True)
result = numpy.argmax(result)
self.assertEqual(result, 4)
===========changed ref 1===========
+ # module: app.Decryptor
+
+
===========changed ref 2===========
# module: app.Tests.test_basic_parent
-
-
===========changed ref 3===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 4===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 5===========
# module: app.Tests.test_basic_parent
- sys.path.append("..")
-
===========changed ref 6===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 7===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 8===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 9===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("\"")
self.assertEqual(result, False)
===========changed ref 10===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 11===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 12===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 13===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 14===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
===========changed ref 15===========
# module: app.languageCheckerMod.dictionaryChecker
class dictionaryChecker:
def __init__(self):
+ self.mh = app.mathsHelper.mathsHelper()
- self.mh = mathsHelper.mathsHelper()
self.languagePercentage = 0.0
self.languageWordsCounter = 0.0
self.languageThreshold = 55
===========changed ref 16===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_two(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
self.assertEqual(result, False)
|
app.Tests.test_neural_network/TestNN.test_md5_yes | Modified | Ciphey~Ciphey | 6009f35c1442c11bba654adefaa01328cb2b94fa | Fixed some Pytest stuff | <0>:<add> model = app.neuralNetworkMod.nn.NeuralNetwork()
<del> model = NeuralNetwork()
| # module: app.Tests.test_neural_network
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_md5_yes(self):
<0> model = NeuralNetwork()
<1> result = model.predictnn("5d41402abc4b2a76b9719d911017c592")
<2> numpy.set_printoptions(suppress=True)
<3> result = numpy.argmax(result)
<4> self.assertEqual(result, 1)
<5>
| ===========unchanged ref 0===========
at: app.neuralNetworkMod.nn
NeuralNetwork()
at: app.neuralNetworkMod.nn.NeuralNetwork
predictnn(text)
at: numpy.core.arrayprint
set_printoptions(precision: None | SupportsIndex=..., threshold: None | int=..., edgeitems: None | int=..., linewidth: None | int=..., suppress: None | bool=..., nanstr: None | str=..., infstr: None | str=..., formatter: None | _FormatDict=..., sign: Literal[None, "-", "+", " "]=..., floatmode: None | _FloatMode=..., *, legacy: Literal[None, False, "1.13", "1.21"]=...) -> None
at: numpy.core.fromnumeric
argmax(a: ArrayLike, axis: None=..., out: None=..., *, keepdims: Literal[False]=...) -> intp
argmax(a: ArrayLike, axis: None | SupportsIndex=..., out: _ArrayType=..., *, keepdims: bool=...) -> _ArrayType
argmax(a: ArrayLike, axis: None | SupportsIndex=..., out: None=..., *, keepdims: bool=...) -> Any
at: unittest.case.TestCase
assertEqual(first: Any, second: Any, msg: Any=...) -> None
===========changed ref 0===========
# module: app.Tests.test_neural_network
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_sha1_yes(self):
+ model = app.neuralNetworkMod.nn.NeuralNetwork()
- model = NeuralNetwork()
result = model.predictnn("6D32263A85C7846D70439026B75758C9FC31A9B7")
numpy.set_printoptions(suppress=True)
result = numpy.argmax(result)
self.assertEqual(result, 0)
===========changed ref 1===========
# module: app.Tests.test_neural_network
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
# ["sha1", "md5", "sha256", "sha512", "caeser", "plaintext"]
class TestNN(unittest.TestCase):
def test_english_yes(self):
"""Checks to see if it returns True (it should)"""
+ model = app.neuralNetworkMod.nn.NeuralNetwork()
- model = NeuralNetwork()
result = model.predictnn("bcpvu up qvu ifs cpplt bxbz, cvu jotufbe tif qvmmfe")
numpy.set_printoptions(suppress=True)
result = numpy.argmax(result)
self.assertEqual(result, 4)
===========changed ref 2===========
+ # module: app.Decryptor
+
+
===========changed ref 3===========
# module: app.Tests.test_basic_parent
-
-
===========changed ref 4===========
# module: app.Tests.test_Encoding
-
-
===========changed ref 5===========
# module: app.Tests.test_caesarcipher_basic
-
-
===========changed ref 6===========
# module: app.Tests.test_basic_parent
- sys.path.append("..")
-
===========changed ref 7===========
# module: app.Tests.test_Encoding
- sys.path.append("..")
-
===========changed ref 8===========
# module: app.Tests.test_caesarcipher_basic
- sys.path.append("..")
-
===========changed ref 9===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_three(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("")
self.assertEqual(result, False)
===========changed ref 10===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_6(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("\"")
self.assertEqual(result, False)
===========changed ref 11===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_five(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("#")
self.assertEqual(result, False)
===========changed ref 12===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_four(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage(".")
self.assertEqual(result, False)
===========changed ref 13===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics_german(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("hallo keine lieben leute nach")
self.assertEqual(result, True)
===========changed ref 14===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_integration_unusual_one(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("HELLO MY NAME IS BRANDON AND I LIKE DOLLAR")
self.assertEqual(result, True)
===========changed ref 15===========
# module: app.Tests.test_integration_languagechecker
# python3 -m unittest Tests.testchi_squared
# python -m unittest discover -s tests
# python3 -m unittest discover -s Tests -p test*.py
class TestLanguageChecker(unittest.TestCase):
def test_basics(self):
+ lc = app.languageCheckerMod.LanguageChecker.LanguageChecker()
- lc = LanguageChecker()
result = lc.checkLanguage("Hello my name is new and this is an example of some english text")
self.assertEqual(result, True)
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.