From ef78ca0177d63d51fc35bb6aef3162bc0d780dbd Mon Sep 17 00:00:00 2001 From: von9880 Date: Fri, 13 Mar 2026 10:49:03 -0400 Subject: [PATCH 01/11] Add files via upload --- tonysEncryption/bigListOfWords.txt | 1290 ++++++++++++++++++++++++++++ tonysEncryption/main.py | 124 +++ 2 files changed, 1414 insertions(+) create mode 100644 tonysEncryption/bigListOfWords.txt create mode 100644 tonysEncryption/main.py diff --git a/tonysEncryption/bigListOfWords.txt b/tonysEncryption/bigListOfWords.txt new file mode 100644 index 0000000..1da83d6 --- /dev/null +++ b/tonysEncryption/bigListOfWords.txt @@ -0,0 +1,1290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Page not found · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ Skip to content + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + +
+ + + + + + + + + + + +
+
+ + + +
+
+ +
+
+ 404 “This is not the web page you are looking for” + + + + + + + + + + + + +
+
+ +
+
+ +
+ + +
+
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + diff --git a/tonysEncryption/main.py b/tonysEncryption/main.py new file mode 100644 index 0000000..c4d8f5d --- /dev/null +++ b/tonysEncryption/main.py @@ -0,0 +1,124 @@ +import math + + +def toAscii(baseString): + convertedValues = [] + for char in baseString: + convertedValues.append(ord(char)) + return convertedValues + +def addRandomVal(asciiArr, val): + convertedValues = [] + for num in asciiArr: + convertedValues.append(num + val) + return convertedValues + + +def bitShift(asciiArr, shiftAmt): + convertedValues = [] + for val in asciiArr: + convertedValues.append(math.ceil(val / (shiftAmt * 2))) + return convertedValues + +def toBinary(asciiArr): + convertedValues = [] + for val in asciiArr: + convertedValues.append(format(val, '08b')) + return convertedValues + + +def toBase64(vals): + vals = toBinary(vals) + b64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + + binaryString = "" + for binary in vals: + binaryString += binary + + groupedVals = [] + for i in range(0, len(binaryString), 6): + groupedVals.append(binaryString[i:i+6]) + + base64String = "" + for group in groupedVals: + decimal_val = int(group, 2) + base64String += b64_chars[decimal_val] + + return base64String + + + +def encrypt(word): + randomVal = 32 + asciiVals = toAscii(word) + pulseRandomVal = addRandomVal(asciiVals, randomVal) + shiftedBinary = (bitShift(pulseRandomVal, 1)) + base64 = toBase64(shiftedBinary) + + + # print("starting string: " + word) + # print("ascii: " + str(toBinary(asciiVals))) + # print("added: " + str(toBinary(pulseRandomVal))) + # print("shifted: " + str(toBinary(shiftedBinary))) + # print("base 64: " + str(base64)) + return base64 + + +def main(): + inputWord = "Hello World!" + encryptedWord = encrypt(inputWord) + print("starting string: " + inputWord) + print("encrypted string: " + encryptedWord) + + +main() + + + + + + +def checkForDuplicatesInWordList(): + dictionaryOfWords = {} + with open("bigListOfWords.txt") as myFile: + for eachWord in myFile: + if eachWord in dictionaryOfWords: + # already in the dictionary? + dictionaryOfWords[eachWord] += 1 + # print("OOPS " + eachWord + " is already in the dictionaryOfWords", end =" / ") + # return + else: + # add to dictionaryOfHashes and set it to 1 appearance + dictionaryOfWords[eachWord] = 1 + # print("no duplicates") + with open("words.txt", "w") as f: + for key in dictionaryOfWords: + f.write(key) + + + +# param functionName - the function that will be tested for collisions +# for example, checkForCollisions(rileySuperSecretEncrypt01) +def checkForCollisions(functionName): + hasCollisions = False + dictionaryOfHashes = {} + with open("bigListOfWords.txt") as myFile: + for eachWord in myFile: + # get each encrypted version + encryptedWord = functionName(eachWord.strip("\n")) + if encryptedWord in dictionaryOfHashes: + # already in the dictionary? + dictionaryOfHashes[encryptedWord] += 1 + print("OOPS " + encryptedWord + " is already in the dictionaryOfHashes", end =" / ") + hasCollisions = True + else: + # add to dictionaryOfHashes and set it to 1 appearance + dictionaryOfHashes[encryptedWord] = 1 + if hasCollisions: + #print(dictionaryOfHashes) + print("\nFAIL: we have collisions") + else: + print("\nSUCCESS: no collisions") + + + From 8be0f3ea84a6e0879ce4ce3466edbc2453555050 Mon Sep 17 00:00:00 2001 From: von9880 Date: Fri, 13 Mar 2026 17:49:30 -0400 Subject: [PATCH 02/11] fixed --- tonysEncryption/bigListOfWords.txt | 1290 ---------------------------- tonysEncryption/main.py | 111 ++- 2 files changed, 48 insertions(+), 1353 deletions(-) delete mode 100644 tonysEncryption/bigListOfWords.txt diff --git a/tonysEncryption/bigListOfWords.txt b/tonysEncryption/bigListOfWords.txt deleted file mode 100644 index 1da83d6..0000000 --- a/tonysEncryption/bigListOfWords.txt +++ /dev/null @@ -1,1290 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page not found · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
-
- - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - - - -
-
- - - -
-
- -
-
- 404 “This is not the web page you are looking for” - - - - - - - - - - - - -
-
- -
-
- -
- - -
-
- -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/tonysEncryption/main.py b/tonysEncryption/main.py index c4d8f5d..ea808d8 100644 --- a/tonysEncryption/main.py +++ b/tonysEncryption/main.py @@ -1,6 +1,20 @@ import math + + +def cipher(word, key): + newWord = "" + + #TODO + + return newWord + + + + + + def toAscii(baseString): convertedValues = [] for char in baseString: @@ -10,14 +24,14 @@ def toAscii(baseString): def addRandomVal(asciiArr, val): convertedValues = [] for num in asciiArr: - convertedValues.append(num + val) + convertedValues.append((num + val) % 127) return convertedValues def bitShift(asciiArr, shiftAmt): convertedValues = [] for val in asciiArr: - convertedValues.append(math.ceil(val / (shiftAmt * 2))) + convertedValues.append(val << shiftAmt) return convertedValues def toBinary(asciiArr): @@ -29,7 +43,7 @@ def toBinary(asciiArr): def toBase64(vals): vals = toBinary(vals) - b64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + b64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" binaryString = "" for binary in vals: @@ -39,86 +53,57 @@ def toBase64(vals): for i in range(0, len(binaryString), 6): groupedVals.append(binaryString[i:i+6]) + last_index = len(groupedVals) - 1 + while len(groupedVals[last_index]) < 6: + groupedVals[last_index] += "0" + + print(str(groupedVals)) base64String = "" for group in groupedVals: - decimal_val = int(group, 2) - base64String += b64_chars[decimal_val] - + foo = 0 + if(group[0] == "1"): + foo += 32 + if(group[1] == "1"): + foo += 16 + if(group[2] == "1"): + foo += 8 + if(group[3] == "1"): + foo += 4 + if(group[4] == "1"): + foo += 2 + if(group[5] == "1"): + foo += 1 + base64String += b64Chars[foo] return base64String - -def encrypt(word): - randomVal = 32 + +def encrypt(word, randomVal): + asciiVals = toAscii(word) pulseRandomVal = addRandomVal(asciiVals, randomVal) shiftedBinary = (bitShift(pulseRandomVal, 1)) base64 = toBase64(shiftedBinary) - # print("starting string: " + word) - # print("ascii: " + str(toBinary(asciiVals))) - # print("added: " + str(toBinary(pulseRandomVal))) - # print("shifted: " + str(toBinary(shiftedBinary))) - # print("base 64: " + str(base64)) + print("starting string: " + word) + print("ascii: " + str(asciiVals)) + print("added: " + str(pulseRandomVal)) + print("shifted: " + str(shiftedBinary)) + print("base 64: " + str(base64)) return base64 def main(): inputWord = "Hello World!" - encryptedWord = encrypt(inputWord) + randomVal = -62054932734650 + + encryptedWord = encrypt(inputWord, randomVal) + print() print("starting string: " + inputWord) print("encrypted string: " + encryptedWord) - main() - - - -def checkForDuplicatesInWordList(): - dictionaryOfWords = {} - with open("bigListOfWords.txt") as myFile: - for eachWord in myFile: - if eachWord in dictionaryOfWords: - # already in the dictionary? - dictionaryOfWords[eachWord] += 1 - # print("OOPS " + eachWord + " is already in the dictionaryOfWords", end =" / ") - # return - else: - # add to dictionaryOfHashes and set it to 1 appearance - dictionaryOfWords[eachWord] = 1 - # print("no duplicates") - with open("words.txt", "w") as f: - for key in dictionaryOfWords: - f.write(key) - - - -# param functionName - the function that will be tested for collisions -# for example, checkForCollisions(rileySuperSecretEncrypt01) -def checkForCollisions(functionName): - hasCollisions = False - dictionaryOfHashes = {} - with open("bigListOfWords.txt") as myFile: - for eachWord in myFile: - # get each encrypted version - encryptedWord = functionName(eachWord.strip("\n")) - if encryptedWord in dictionaryOfHashes: - # already in the dictionary? - dictionaryOfHashes[encryptedWord] += 1 - print("OOPS " + encryptedWord + " is already in the dictionaryOfHashes", end =" / ") - hasCollisions = True - else: - # add to dictionaryOfHashes and set it to 1 appearance - dictionaryOfHashes[encryptedWord] = 1 - if hasCollisions: - #print(dictionaryOfHashes) - print("\nFAIL: we have collisions") - else: - print("\nSUCCESS: no collisions") - - - From d3f7273bae5f5bb53bd22fb165a316c368eaa131 Mon Sep 17 00:00:00 2001 From: von9880 Date: Sat, 14 Mar 2026 14:07:51 -0400 Subject: [PATCH 03/11] Update main.py --- tonysEncryption/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tonysEncryption/main.py b/tonysEncryption/main.py index ea808d8..dd2fc41 100644 --- a/tonysEncryption/main.py +++ b/tonysEncryption/main.py @@ -95,8 +95,8 @@ def encrypt(word, randomVal): def main(): - inputWord = "Hello World!" - randomVal = -62054932734650 + inputWord = "hello" + randomVal = 1324657869764524231 encryptedWord = encrypt(inputWord, randomVal) print() From 1ceebeb9593b1f89a7881a6731ba19895f9f64a9 Mon Sep 17 00:00:00 2001 From: von9880 Date: Sat, 14 Mar 2026 15:13:30 -0400 Subject: [PATCH 04/11] stuff and things --- .../__pycache__/decrypt.cpython-311.pyc | Bin 0 -> 1728 bytes .../__pycache__/encypt.cpython-311.pyc | Bin 0 -> 4522 bytes tonysEncryption/decrypt.py | 44 ++++++++ tonysEncryption/encypt.py | 100 ++++++++++++++++++ tonysEncryption/main.py | 88 +-------------- 5 files changed, 146 insertions(+), 86 deletions(-) create mode 100644 tonysEncryption/__pycache__/decrypt.cpython-311.pyc create mode 100644 tonysEncryption/__pycache__/encypt.cpython-311.pyc create mode 100644 tonysEncryption/decrypt.py create mode 100644 tonysEncryption/encypt.py diff --git a/tonysEncryption/__pycache__/decrypt.cpython-311.pyc b/tonysEncryption/__pycache__/decrypt.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a2f882a63764981145c1841d3946db9ad53c1b3 GIT binary patch literal 1728 zcma)6L2nyH6rR~#uQvp5B0_36l^TaaBa_gCHl!&+h$K!Epmk`Sv=Etty}Plu*t_n` z+KHoe@PUItK~xASsRWWwpo$9@Zu|%vS;ATg2?_O(Tcq52;?2ai>YyN=#&6zx``*mF z&)>{Xfxrt0Wc-(3%}EiVznRk!@VOi>z_gEaq~k2g;SHPuq`93Gb>EB zq(u`^TPx%Y%b|&7(^)B`5=&XrF&0ZHs5P_#F`d%7WjYDRwn}u#(nu-qn6{PB4Q^h^ zm%M&{qBVOllOzNV&fBI}z^I_s&~W8;Yan=pu^@XWcAFh=;EC|gnIGBXzzk60G2ogNXp54 z-mvtDL?97)3eA|C&V0`C2D*seOJ)lOCH?T7N}vGKFnN(>2U4aJX9ai7bjBe=5MyzA z9TfC?E>u}<_dCt{oo4+8|4=Ueu3S8zwanws8_HBunX2>A>K~~~BSeMT9^%Ll;KV5c zNlu8pJ2igD`nM)6$J?!v0*(mnWv>cp`O3#P9W`W@q9KMADuDCc914^Me&D zAc%Jd}4X&zEOBwh^{Yrhby}$eIZcT3lCz`>DhBDbyChL4WRnI-zYN(@4b+od4 zvcgMzg>kmRcvbGKP&{~88#~ziZnvRaZYr1Sd_0xu4~*^q)wDOi_+fBw%H zq{85r#q&?!ux^#+)?)yiY*-q+N*q(dE-PVV<}VSyp1k)bh!=8fo+1`q|@1kuY@IRjPz9Ft@GL0USC)UG*x$Y9&xL8z|I7p?YWVll%jY CDTYG; literal 0 HcmV?d00001 diff --git a/tonysEncryption/__pycache__/encypt.cpython-311.pyc b/tonysEncryption/__pycache__/encypt.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f12052da4aea6da214d5d4f13cd41a539fcbf49 GIT binary patch literal 4522 zcmc&%-EZ606(_|@iJ~moa$?6HiLKO@4Ow2|uY5Fd);e)Mn<#7DbZzElkVPiZVpHBF z?ZgI!>R|)aA_F{NLmeOOb*`tg z#cU~7VploPRU%z)U@({RAXbV9PiF9IP+C3qm3FcYkrl>K(D9QCk`D?SZ9b&7ZG zqc|9Am&)C!GDS1e5I~I3W_UP~em{NJm|8HHwzLJ>c4|A9HfB)hx_Z~3Z6FXvp;G{j z+K!;MBX!!Y>xKJIzOtm_wsgG2u6jjl8vrIkOS2We4VAhr6@Aw&rSQ+dV_wv}W|#T{ zxT#>p9bx43T+G8(-0|Mc(1oNC6PPXPEP($~TW-n7oKI^>xO*y>Z!6ck}K z$Z^n16rrxw547VVB>WV17dq4(ITr4nN{<9+4h_-=RGSsJ9bJSIF4)6i0wf zqa$yD7gcG)>&nnUXdZxD*8u8`ipl$%@EQs1oRSIaFu zg+8k#x)yp%)4ywWUVkV1)^?r=)`RfKXCW-YuET)lL;ISpEj^DV2z11#TN_3AZ(&U# z&tTnN;M%bQ^Szf9O;V`s(P|Gq;X9%!Dg-(Ej~?7-ZrQaSeGT6vjs1$a3QU~!Hp-aZ zz2;NM1NIpjGl}Vab~tVsm-kdSKKKu3OU))a4r4;q< zz5D6kJ(yq6GK;^by0NtU@X^ZZ$mrPk#EFxqPQM>NPTvD7Z=t2PFiYD)Z>9YRefSzd zzz|2fu_hs)gKiOydM#mh2u>}K{ zXEF3JdHMnLj>E104Riw1X#O~N<+}rIx$EWDc4XLI21v69*S(h1lW)p5eb;(0_t9ps zb#3&osr6y2eb8Fg`K5B=L7N)FlGAE%g@0Eos1g zv!vc11TGMI>!=^RoGAaPFaN-jyKK43BHcFWE|Kms(=mK_n+u7+gaCQ59BPI@8)#Vz zKR&&tfAc~9gK|^z+Su1ufh6Cpb@b~iZ;}1^tzc}aaNudslA>tva^O&j9NL}7p`)Rn zy*b86ww^@I9hq9z(?B(FqG(KPvVwtrS}73fcJ`D1jd-%6f$3*;Ua^sufKq`Bt3`qE zfJEIW!*dNXf`R#ErR+TO>^qt?jNTEJ_Z=-ZjNU=G`;PY3k2Wybt!lBuDvkQ@JFl;P zUemk(XwwU{C?#kdzP}pQjU+YTv`+pU z{7W!*b+hegAy)jtYCC1OoysNf_1Md!R@;Q#Hj%rr+19;rrSPS7c-%fbUTI8h2HVy& zD;Twd(cC3QFD3a%fmm|CMWQx|mPmAy`1A1%Vg2fp(9;mGm_-I{GFT#m)sBSK5w|2`E4)ZAseqjs8(Zb`@Ui#%2yyHW32{V5x!%atHCti N%(rfHyMg`be*oA!y3+sv literal 0 HcmV?d00001 diff --git a/tonysEncryption/decrypt.py b/tonysEncryption/decrypt.py new file mode 100644 index 0000000..157d6b4 --- /dev/null +++ b/tonysEncryption/decrypt.py @@ -0,0 +1,44 @@ +from encypt import toBinary, base2ToDecmail, invert + + + +def asciiToChar(asciiArr): + convertedWord ="" + for val in asciiArr: + convertedWord += chr(val) + return convertedWord + + +def bitShiftRight(asciiArr, shiftAmt): + convertedValues = [] + for val in asciiArr: + convertedValues.append(val >> shiftAmt) + return convertedValues + + +def base64ToBase2(b64String): + b64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + + b64Nums = [] + for char in b64String: + b64Nums.append(b64Chars.index(char)) + + ob8Nums = toBinary(b64Nums) + + ob6Nums = [] + for binary in ob8Nums: + ob6Nums.append(binary[2:8]) + + binaryString = "" + for binary in ob6Nums: + binaryString += binary + + convertedVals = [] + for i in range(0, len(binaryString) // 8): + convertedVals.append(binaryString[i * 8:((i+1) * 8)]) + + return convertedVals + + + + diff --git a/tonysEncryption/encypt.py b/tonysEncryption/encypt.py new file mode 100644 index 0000000..b9d85b2 --- /dev/null +++ b/tonysEncryption/encypt.py @@ -0,0 +1,100 @@ + + +def toAscii(baseString): + convertedValues = [] + for char in baseString: + convertedValues.append(ord(char)) + return convertedValues + + +def addRandomVal(asciiArr, val): + convertedValues = [] + for num in asciiArr: + convertedValues.append((num + val) % 127) + return convertedValues + + +def bitShiftLeft(asciiArr, shiftAmt): + convertedValues = [] + for val in asciiArr: + convertedValues.append(val << shiftAmt) + return convertedValues + + +def toBinary(asciiArr): + convertedValues = [] + for val in asciiArr: + convertedValues.append(format(val, '08b')) + return convertedValues + + +def base2ToDecmail(binaryArr): + convertedVals = [] + for binary in binaryArr: + convertedVals.append(int(binary, 2)) + return convertedVals + + +def invert(binaryArr): + convertedVals = [] + for binary in binaryArr: + invertedBinary = "" + for bit in binary: + if(bit == "1"): + invertedBinary += "0" + if(bit == "0"): + invertedBinary += "1" + convertedVals.append(invertedBinary) + return convertedVals + + +def toBase64(vals): + b64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + + binaryString = "" + for binary in vals: + binaryString += binary + + groupedVals = [] + for i in range(0, len(binaryString), 6): + groupedVals.append(binaryString[i:i+6]) + + last_index = len(groupedVals) - 1 + while len(groupedVals[last_index]) < 6: + groupedVals[last_index] += "0" + + print(str(groupedVals)) + base64String = "" + for group in groupedVals: + foo = 0 + if(group[0] == "1"): + foo += 32 + if(group[1] == "1"): + foo += 16 + if(group[2] == "1"): + foo += 8 + if(group[3] == "1"): + foo += 4 + if(group[4] == "1"): + foo += 2 + if(group[5] == "1"): + foo += 1 + base64String += b64Chars[foo] + return base64String + +def encryptString(word, randomVal): + + asciiVals = toAscii(word) + pulseRandomVal = addRandomVal(asciiVals, randomVal) + shiftedBinary = (bitShiftLeft(pulseRandomVal, 1)) + invertedBinary = invert(toBinary(shiftedBinary)) + base64 = toBase64(invertedBinary) + + + print("starting string: " + word) + print("ascii: " + str(asciiVals)) + print("added: " + str(pulseRandomVal)) + print("shifted: " + str(shiftedBinary)) + print("inverted: " + str(base2ToDecmail(invertedBinary))) + print("base 64: " + str(base64)) + return base64 \ No newline at end of file diff --git a/tonysEncryption/main.py b/tonysEncryption/main.py index dd2fc41..6dd04ee 100644 --- a/tonysEncryption/main.py +++ b/tonysEncryption/main.py @@ -1,5 +1,4 @@ -import math - +from encypt import encryptString @@ -12,93 +11,11 @@ def cipher(word, key): - - - -def toAscii(baseString): - convertedValues = [] - for char in baseString: - convertedValues.append(ord(char)) - return convertedValues - -def addRandomVal(asciiArr, val): - convertedValues = [] - for num in asciiArr: - convertedValues.append((num + val) % 127) - return convertedValues - - -def bitShift(asciiArr, shiftAmt): - convertedValues = [] - for val in asciiArr: - convertedValues.append(val << shiftAmt) - return convertedValues - -def toBinary(asciiArr): - convertedValues = [] - for val in asciiArr: - convertedValues.append(format(val, '08b')) - return convertedValues - - -def toBase64(vals): - vals = toBinary(vals) - b64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" - - binaryString = "" - for binary in vals: - binaryString += binary - - groupedVals = [] - for i in range(0, len(binaryString), 6): - groupedVals.append(binaryString[i:i+6]) - - last_index = len(groupedVals) - 1 - while len(groupedVals[last_index]) < 6: - groupedVals[last_index] += "0" - - print(str(groupedVals)) - base64String = "" - for group in groupedVals: - foo = 0 - if(group[0] == "1"): - foo += 32 - if(group[1] == "1"): - foo += 16 - if(group[2] == "1"): - foo += 8 - if(group[3] == "1"): - foo += 4 - if(group[4] == "1"): - foo += 2 - if(group[5] == "1"): - foo += 1 - base64String += b64Chars[foo] - return base64String - - - -def encrypt(word, randomVal): - - asciiVals = toAscii(word) - pulseRandomVal = addRandomVal(asciiVals, randomVal) - shiftedBinary = (bitShift(pulseRandomVal, 1)) - base64 = toBase64(shiftedBinary) - - - print("starting string: " + word) - print("ascii: " + str(asciiVals)) - print("added: " + str(pulseRandomVal)) - print("shifted: " + str(shiftedBinary)) - print("base 64: " + str(base64)) - return base64 - - def main(): inputWord = "hello" randomVal = 1324657869764524231 - encryptedWord = encrypt(inputWord, randomVal) + encryptedWord = encryptString(inputWord, randomVal) print() print("starting string: " + inputWord) print("encrypted string: " + encryptedWord) @@ -106,4 +23,3 @@ def main(): main() - From 85b6eb555eb57f0c225982fc7c21d7eb6a29d46d Mon Sep 17 00:00:00 2001 From: von9880 Date: Sun, 15 Mar 2026 12:02:30 -0400 Subject: [PATCH 05/11] stuff --- .../__pycache__/decrypt.cpython-311.pyc | Bin 1728 -> 2755 bytes .../__pycache__/encypt.cpython-311.pyc | Bin 4522 -> 3811 bytes tonysEncryption/cipher.py | 7 ++++++ tonysEncryption/decrypt.py | 22 +++++++++++++++++- tonysEncryption/encypt.py | 13 +++++------ tonysEncryption/main.py | 19 ++++----------- tonysEncryption/vigenereTable.py | 0 7 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 tonysEncryption/cipher.py create mode 100644 tonysEncryption/vigenereTable.py diff --git a/tonysEncryption/__pycache__/decrypt.cpython-311.pyc b/tonysEncryption/__pycache__/decrypt.cpython-311.pyc index 5a2f882a63764981145c1841d3946db9ad53c1b3..c7702999b38a5414a3fdc2850dfae3b721692c9f 100644 GIT binary patch literal 2755 zcmaJDTW`}=*p3~?C704RO)o$j?xZbE>7aDuqP4VZ$E6HfV4w^su}y21+TF2JXmMB` zHmRDBhNevo5=hw#E8+!SrakR9#K;nnrAkQC9{N^^H(s{y96M2+N__J9d~V-&&UZh5 zgu^>1fZ;cP$_z(Q|KLFt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sAZVrS{58A@8AWMOMPncZl1TM$V!h%MEI#UR#7u^>gFNA+M^kld2&Hd#nEadr&`q)`xz zqA0Flk9twWgI>IO5c~rP70l7ASp!#yAjZ?@R*Rt;mSyjkd!g2jj@qA&b!6Ux381i!5El(biiV^o z;*+tEKiZW>)4Er;SHxM|m%ruJkRpW;vJH#+3uG7radF4wcU;$4Kd>=~h)urFeQ5FnMoy+(43pRJ?BJ_m3ue${@+;B? zs?%hfY{)OgXgfKYKaa~5C=deD95VSbe*o(TAqF0y$;SmW6+xyJfn--Q6mf&toIv6i ghfQvNN@-52U6K1_LBU*pc}9s33~<6}a<8B)02NU+MgRZ+ delta 799 zcma)3L2DC16rN39Hpy&uLs|;ShR8yahGc^l8jGX}y+}(1qbPb5qKS1;7nxl=#6V6$ zFCKIdEHvUtrM)Os@Z`Z?umgjXfG6)-DBhiEj93)ngZIt%=6!Ew-n_55oxJ`^*D(^d z@aDbazSYk}mHysp^nya)C6+=8+It!sC?_JL2x+?;-BI{X*Cin2qsTqtxc(^Y`Gn5n z9$pcfi^9FeyG z!7uBC`lu)PO9i1_;bT+KF-_P{(g#tqFjWXbxT5}tFd~HCqvpcY6IDMsc@#o^ihfI& zk3SlNsddpm>-y^P_Wo7fS1+S-tVL{bT`%SNZQ?ubh9$mSEOo0FZ+kZ!r*2u2UhQZ6QKz{?#M6*8uv{10Q diff --git a/tonysEncryption/cipher.py b/tonysEncryption/cipher.py new file mode 100644 index 0000000..94185da --- /dev/null +++ b/tonysEncryption/cipher.py @@ -0,0 +1,7 @@ + +def cipher(word, key): + newWord = "" + + #TODO + + return newWord diff --git a/tonysEncryption/decrypt.py b/tonysEncryption/decrypt.py index 157d6b4..14742dc 100644 --- a/tonysEncryption/decrypt.py +++ b/tonysEncryption/decrypt.py @@ -1,4 +1,4 @@ -from encypt import toBinary, base2ToDecmail, invert +from encypt import * @@ -8,6 +8,15 @@ def asciiToChar(asciiArr): convertedWord += chr(val) return convertedWord +def subRandomVal(randomArr, val): + return addRandomVal(randomArr, (-1 * val)) + + +def base2ToDecmail(binaryArr): + convertedVals = [] + for binary in binaryArr: + convertedVals.append(int(binary, 2)) + return convertedVals def bitShiftRight(asciiArr, shiftAmt): convertedValues = [] @@ -37,8 +46,19 @@ def base64ToBase2(b64String): for i in range(0, len(binaryString) // 8): convertedVals.append(binaryString[i * 8:((i+1) * 8)]) + return convertedVals +def decryptString(encyptedWord, randomVal): + invertetedWord = base64ToBase2(encyptedWord) + ShiftedBinary = invert(invertetedWord) + shiftedVals = base2ToDecmail(ShiftedBinary) + randomVals = bitShiftRight(shiftedVals, 1) + ascii = subRandomVal(randomVals, randomVal) + decryptedWord = asciiToChar(ascii) + return(decryptedWord) + + diff --git a/tonysEncryption/encypt.py b/tonysEncryption/encypt.py index b9d85b2..7c3f6a9 100644 --- a/tonysEncryption/encypt.py +++ b/tonysEncryption/encypt.py @@ -63,7 +63,6 @@ def toBase64(vals): while len(groupedVals[last_index]) < 6: groupedVals[last_index] += "0" - print(str(groupedVals)) base64String = "" for group in groupedVals: foo = 0 @@ -91,10 +90,10 @@ def encryptString(word, randomVal): base64 = toBase64(invertedBinary) - print("starting string: " + word) - print("ascii: " + str(asciiVals)) - print("added: " + str(pulseRandomVal)) - print("shifted: " + str(shiftedBinary)) - print("inverted: " + str(base2ToDecmail(invertedBinary))) - print("base 64: " + str(base64)) + # print("starting string: " + word) + # print("ascii: " + str(asciiVals)) + # print("added: " + str(pulseRandomVal)) + # print("shifted: " + str(shiftedBinary)) + # print("inverted: " + str(invertedBinary)) + # print("base 64: " + str(base64)) return base64 \ No newline at end of file diff --git a/tonysEncryption/main.py b/tonysEncryption/main.py index 6dd04ee..99aa57e 100644 --- a/tonysEncryption/main.py +++ b/tonysEncryption/main.py @@ -1,24 +1,15 @@ -from encypt import encryptString - - - -def cipher(word, key): - newWord = "" - - #TODO - - return newWord - - +from decrypt import encryptString, decryptString def main(): - inputWord = "hello" + inputWord = "Hello World!" randomVal = 1324657869764524231 encryptedWord = encryptString(inputWord, randomVal) + decryptedWord = decryptString(encryptedWord, randomVal) print() - print("starting string: " + inputWord) print("encrypted string: " + encryptedWord) + print("decrypted string: " + decryptedWord) + main() diff --git a/tonysEncryption/vigenereTable.py b/tonysEncryption/vigenereTable.py new file mode 100644 index 0000000..e69de29 From fa285bc83ca24c898307e33552936d7a5d808e24 Mon Sep 17 00:00:00 2001 From: von9880 Date: Mon, 16 Mar 2026 10:48:22 -0400 Subject: [PATCH 06/11] yk --- .../__pycache__/decrypt.cpython-39.pyc | Bin 0 -> 1677 bytes .../__pycache__/encypt.cpython-39.pyc | Bin 0 -> 2193 bytes tonysEncryption/decrypt.py | 2 +- tonysEncryption/{encypt.py => encrypt.py} | 0 tonysEncryption/main.py | 2 +- tonysEncryption/vigenereTable.py | 59 ++++++++++++++++++ 6 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 tonysEncryption/__pycache__/decrypt.cpython-39.pyc create mode 100644 tonysEncryption/__pycache__/encypt.cpython-39.pyc rename tonysEncryption/{encypt.py => encrypt.py} (100%) diff --git a/tonysEncryption/__pycache__/decrypt.cpython-39.pyc b/tonysEncryption/__pycache__/decrypt.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..13e06ad7b15002e9f9c70e9f5d67fdfe8d0bb750 GIT binary patch literal 1677 zcmZux-Etc>6qfeij-7;zDH8^mPVW|Gprom5m=5HZmOmF9rv;6o9tJ{e*-Y3-CZfTF`f6 zisrJ}Fgoxa!kfPX9j9}u$r1Tsb8cy>h_){1Ju;_ffu`WcY8U9mj)yX|iy+G5B-xje z)#EHZ7g7oSB$K?b&!f@rMEctM_D`_i&W*k2Z?$(?e~sH zi4upiKI{?kR3>V6nkK5JvUHXor?H$(RFb7VE{ys9WLB)1gS*+`Fp@4p51=E|p#fc| zvI2ID-2L0oUPZYM6Nn2U)wDq_EECn@Z)hQ9wTSahl=5u+I2wf(t4K3}5G7nt8IcJ~ z;)z8qpY~VV*WgQTj-?XqSBORrhUi;h41iQabOVXLB#LT_(+lebrDR3+0^NmH;YE{) zNP*WRRiVu){UnX#3{Vv>i3h-W;gu^TM5MpOx!#X*vD3|tL_Cg?(FQDBp=^uF*Wk-F z%8)K(*5JJf2H>>}-mSTO0?kY$77nIv?f_h-j zt$9TU;KSDyZZ`<@-Wvq1mA`Wx06~8H`QHA);nDGD4<3I0#g|`w-G21Vx1E#j>EkEg zeb1tP%*E5eF!}MP(KyW}XEImQ^Piv1p5Oj(=g#ik=DpTO?|mR^5a$B5CvEI7mlxQD zuHn9Llaz~REKu2j(MaKff(N3oMGb7Gh?KkK*5 z6pSVsauW_fb}Sr)Nn?t^66dik4JF0r~1s^BHZY|SWLa7;l~ElY+; zN7vM;qP{F$rQ=sPTdtPO-UYNd)+hpe;Zubtpz>|_(hhy*l^6}=5B7fEpw#+ literal 0 HcmV?d00001 diff --git a/tonysEncryption/__pycache__/encypt.cpython-39.pyc b/tonysEncryption/__pycache__/encypt.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c5b7a498b718b54b5dfc5a24b83c8329787a32a GIT binary patch literal 2193 zcmb_dPj4GV6rb7IU9TP6X(N+A1&M$vgjK1eZAb!&s-{V4DQ%!lTVQ2`)}BqW#NKsg z*J)j?1ybOO_y8Qju{Vx<06qlTDu zsQeM!$LMbo#vcR14Sewi8p$O8k-1D7QlRJ3loonJ+OmLNNJkdYo3bP)&|9)BE9h-m zm6PZT^4u1ypKoz2_3{xISoqfQ#q(%(*np>OgMBkKFj9WR5}q1|{5Q_ozLWAT_JVKL zjm-ACT|bnWh?J}gx774ve=AWzxRXt`qVT|1i7%gc?VcZJW^30|FPO5i`o9laA2%My zzKR9Z2VSF1xf#L7$l7(3j6V`u%-Il zB#6R>AGR>M-0f$DBwCAGK|rCz4jRTy?(lP5kiRJi36{#XjNB)y^ansZwk<5Wlze7UMQmu zQbFfD=3b4f3N){GZyvM9?oFMzcYVw?MMtS<<+`aR&}B}%8*C?QokV-3$}~@jANQ&m zBwJ*4&)-hYV{XhVByAF!S0F-5Xo$Rv!7)T?ClHbR&^Q4JQs#<+WPBkG!;b zsE+ct#LHa01^uZrAmkC!byzik5utEtjB2V(VWkv?v0p~OX2PV%`9zwB0s&tbSgCnr zz{*N3Y0j{pjJX`%mtkifa%s)7flcGoo@0>BJ*J+KWU)CW?PVs|D%*d8JqxLc6@MN$ zQVfbITFe)ax?j_xbl?N&tdZ__=!zpl?Q|xqau;yPw^=zxnwW4<2qkdi>px$(a`oEchfB*VA6@!DQAG^#u_4vsP#69MjMN;7 z^VFOpaf(Jnd_&^HA%Sj4=mX9z<%K(bCfa_OGg-+s!C!IaG?y0FLDF$n&Hd5WGrg zYkbxygRrNx#st)ySH3EARjw}K&r_U9@S{jI1Q#(#SPGyF3<6pTRvL%|AS8YQ07Zfd zJLH(R56;*NF)^~(8KE;)n6_LuE*4?7M3_$R)TkZDR zv470?Zbg%^FY~%nZ(;{fiq6B?1XXaK(bblx@)0a!;%;UjLwJ#qqPh%uv+kUAk(f~t l?@[\\]^_`{|}~ ' + + for char in ShiftingWord: + charters = charters.replace(char, "") + + + startingRow = ShiftingWord + charters + + table = [startingRow] + + for i in range(len(startingRow) - 1): + temp = table[i][0] + newRow = table[i][1:] + temp + table.append(newRow) + + return table + + + + +def encryptWithTable(word, key): + table = makeTable(superSecretWord) + + + + + + + + + + + + + + + +#AI made this +def printTable(table): + print("\n--- Generated Cipher Square ---") + + # Loop through the table, keeping track of the row number (i) and the row data + for i, row in enumerate(table): + # Format the row number to always be at least two digits (e.g., 00, 01, 10) + # to keep everything perfectly aligned + print(f"Row {i:02d}: {row}") + + print("-------------------------------\n") + + +foo = makeTable("kryptos KRYPTOS") +printTable(foo) From 72073e426e1d223d3ae065d52322cc6c053dd078 Mon Sep 17 00:00:00 2001 From: von9880 Date: Mon, 16 Mar 2026 21:35:35 -0400 Subject: [PATCH 07/11] second encryption algorithm --- .../__pycache__/decrypt.cpython-311.pyc | Bin 2755 -> 2756 bytes .../__pycache__/encrypt.cpython-311.pyc | Bin 0 -> 3812 bytes .../__pycache__/vigenereTable.cpython-311.pyc | Bin 0 -> 4081 bytes tonysEncryption/decrypt.py | 2 +- tonysEncryption/main.py | 23 ++++++- tonysEncryption/vigenereTable.py | 62 ++++++++++++++++-- 6 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 tonysEncryption/__pycache__/encrypt.cpython-311.pyc create mode 100644 tonysEncryption/__pycache__/vigenereTable.cpython-311.pyc diff --git a/tonysEncryption/__pycache__/decrypt.cpython-311.pyc b/tonysEncryption/__pycache__/decrypt.cpython-311.pyc index c7702999b38a5414a3fdc2850dfae3b721692c9f..8d7dda98f16892b71d9d5ad4fb91b02d12d377d7 100644 GIT binary patch delta 47 wcmX>sdPJ0WIWI340}y1b-jT_&k@qtvD|>2Qa?xZKE*~z@3k*;+If^S206wG*O#lD@ delta 46 vcmX>idRUZqIWI340}xnT+Lp<@k@qtv3tMVl@?=&nA1;v#3{W&Vnky3kE71(e diff --git a/tonysEncryption/__pycache__/encrypt.cpython-311.pyc b/tonysEncryption/__pycache__/encrypt.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ec756fa1edb0fb19e4572b427e07c54dd6ca4818 GIT binary patch literal 3812 zcmc&%-ER|D7N1Z1+KKJh;3OnzK1v;AU?E?8beG+3Ae2B!*f!8@S+^_4GYM0iarVwQ zB+*#)!>;63dGJcD2ogx{3pHXN`nc*};X#(LMv7Fa>OwWuAPvUKJC@a zZ|3+PqI92fVcc6Y(eJaCI}zxV*)KDWr_c#E6jK6)c3SbPa+`-h4A^3>H09~q^I2Wt=4Y!a`Mc!gcH zww{XA^8$X%r3A$Kkm1QRehnr};{wz8YdO&pN_D2zhb3D4I*=589qhGF$NiQ7b`@r~ zKLwsAJeA-PmmHErIVLG}#Fb>4dV%VQdUnacbx`Xd^&zP}sVMIybtSU|x~CB!q2$H| zfL*CWT`2GvgM!$Qx+IoTU-`;&_P~fuMyq7B!Y)^E+6EiET<|GaX%f8W7X$}o?Gw2d zMW(1m8U%<-G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z9?8!zW6s9OUWqY9vF5~;9Rrc#VV-d87woVY|I$#7hkc0^K}UNan^vI0ls^OYrsW5#7B0x{lHH8KU3y9S^xk5 literal 0 HcmV?d00001 diff --git a/tonysEncryption/__pycache__/vigenereTable.cpython-311.pyc b/tonysEncryption/__pycache__/vigenereTable.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2461064135652733e5723f8900bbe4db7cb4474a GIT binary patch literal 4081 zcmeHK-A@}=7Qf?}vBx&H0TV(B4aN|H$wHd2Nh!45r9eJg(!?QYSZA}2X9C7BcJ2%$ zIOCNob)})QRA)t0ML%~F(?JngyHe0WHOw!07e zvX{AM=H7EZj?cZn-#Prn<8dJ63OQd8$njkOvpvT1OSwGZ|m&hQ$i@rSmTKq9yMow4uHu_F3|ZC9_^ zsU;4LE7n=DvlP-C*8Lcidr#xQW&G6ZTko7WIrPg@r{5iZFM2yBN_S@G;`51xMLC(e zixqWg`QH7N^w>w^6O(7oo;!cx;>Vv%UHbI$mGIT+Yu7)!G1C?7?m5zXv@g_u>=y%r z$45rr|KP)4{rWeNo4>vFy9Zk4_W={VApXb1c_GepU@5f_jY%etqw=g|vI~-I+M}tI zB#R-zYzWWA@2GKk_IeVFrVyKpVpYP5$&oM9t*Foj?Um#`lUJj+7bKI3o17{wrcApm z-GhEbfQe3FIkFs|m1GG^SBWu$sTI?? z7){h#xCJaB)+pbC$f8Xj&Ys(B?5HA!AEZL(D*pB#{oNb>?&8GvLBl^#_7CWSE>!Kv z-&t%knnT%(o1QlPlkDVkPxGUp`~$<^U53$7!++H9^p!n*RmAddQ=u~zUrYXS?tX#E zJ%FW~TJv|;+6rBTU?I5HQRIxK9^GCMJYO|@*^s|x2pwgiqeP!gcVqVBmtZ7{?c8x_ zIG|FjT!7xMky?i%ZO;w1=oss5OK@am9MKp+j0X_ISVsSxmB>N}AJiCe-!LTW{NNca_{-mF5HaC`>u?*uCz~ zFP58o^zl~?1cQHKu~!Yq)A}fBH1w7mdb5+8jm_Ef0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Y2Mvx#gXAN)M|Mbbd6Wz<^QeyD~2 E0w;Ps_5c6? literal 0 HcmV?d00001 diff --git a/tonysEncryption/decrypt.py b/tonysEncryption/decrypt.py index 327a75d..7501bf0 100644 --- a/tonysEncryption/decrypt.py +++ b/tonysEncryption/decrypt.py @@ -1,4 +1,4 @@ -from tonysEncryption.encrypt import * +from encrypt import * diff --git a/tonysEncryption/main.py b/tonysEncryption/main.py index ead9022..e134a8f 100644 --- a/tonysEncryption/main.py +++ b/tonysEncryption/main.py @@ -1,11 +1,28 @@ from decrypt import encryptString, decryptString +from vigenereTable import encryptWithTable, decryptWithTable def main(): - inputWord = "Hello World!" - randomVal = 98154164 - + inputWord = " like to eat my ham. It makes me feel like shlam. Have you seen the movie Kazam? But back to ham. Did you know that an imam is a man who leads the prayer in a mosque? What if you pronounced imam, e-mam? Would that make you think of ham? My name is Stan. Ham." + + # encrypting with base 64 and random nonsense first assingment + randomVal = 98154164 encryptedWord = encryptString(inputWord, randomVal) decryptedWord = decryptString(encryptedWord, randomVal) + + print("------ENCRYPTING WITH BASE 64------") + print() + print("encrypted string: " + encryptedWord) + print("decrypted string: " + decryptedWord) + + + + # encrypting with vigenere table second assingment + superSecretKey = "[:KV&jHc3fHkQBC" + encryptedWord = encryptWithTable(inputWord, superSecretKey) + decryptedWord = decryptWithTable(encryptedWord, superSecretKey) + + print() + print("------ENCRYPTING WITH VIGENERE TABLE------") print() print("encrypted string: " + encryptedWord) print("decrypted string: " + decryptedWord) diff --git a/tonysEncryption/vigenereTable.py b/tonysEncryption/vigenereTable.py index d4b56b0..24266c5 100644 --- a/tonysEncryption/vigenereTable.py +++ b/tonysEncryption/vigenereTable.py @@ -1,5 +1,7 @@ -superSecretWord = "kryptos KRYPTOS" +import random + +superSecretWord = "kryptos KRYPTOS" #the key cant have any duplicate chars @@ -24,21 +26,72 @@ def makeTable(ShiftingWord): +def encryptWithTable(string, key): -def encryptWithTable(word, key): + while(len(string) > len(key)): + key += key + if(len(string) < len(key)): + key = key[0:len(string)] + + table = makeTable(superSecretWord) + #printTable(table) + newString = "" + + for i in range(0, len(string)): + + col = table[0].index(string[i]) + + for j in range(0, len(table)): + + row = 0 + if(table[j][0] == key[i]): + row = j + break + + newString += table[row][col] + return newString + +def decryptWithTable(string, key): + while(len(string) > len(key)): + key += key + if(len(string) < len(key)): + key = key[0:len(string)] + + table = makeTable(superSecretWord) + convertedString = "" + for i in range(len(string)): + row = 0 + for j in range(len(table)): + if table[j][0] == key[i]: + row = j + break + + col = table[row].index(string[i]) + convertedString += table[0][col] + return convertedString +def generateKey(length): + charters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ ' + + key = "" + + for i in range(length): + randIndex = random.randint(0, len(charters) - 1) + key += charters[randIndex] + + return key @@ -55,5 +108,6 @@ def printTable(table): print("-------------------------------\n") -foo = makeTable("kryptos KRYPTOS") -printTable(foo) + +#to make an uniqe key every time i run this file becuse im lazy +print(generateKey(15)) \ No newline at end of file From ef1dd073f46bed3f5ffeb03aebb57f8d6c4e1c33 Mon Sep 17 00:00:00 2001 From: von9880 Date: Tue, 17 Mar 2026 10:37:25 -0400 Subject: [PATCH 08/11] jcdhg --- .../__pycache__/decrypt.cpython-39.pyc | Bin 1677 -> 1678 bytes .../__pycache__/encrypt.cpython-39.pyc | Bin 0 -> 2194 bytes .../__pycache__/vigenereTable.cpython-39.pyc | Bin 0 -> 1960 bytes tonysEncryption/hash.py | 0 .../{cipher.py => transpositionCipher.py} | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tonysEncryption/__pycache__/encrypt.cpython-39.pyc create mode 100644 tonysEncryption/__pycache__/vigenereTable.cpython-39.pyc create mode 100644 tonysEncryption/hash.py rename tonysEncryption/{cipher.py => transpositionCipher.py} (100%) diff --git a/tonysEncryption/__pycache__/decrypt.cpython-39.pyc b/tonysEncryption/__pycache__/decrypt.cpython-39.pyc index 13e06ad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(iJ;VbR1q(*xK|mT#1*_0AL2etAe({ z&l*(__N>;JfSPmSt3y}k>H_|Jg)<3$6sd;b5(WuN0hEzJKuf_&Bar}v#7_XANKj$> z9P?HJ$f37WTT{HEDsI~P&d|)PiBLmcbC2G+S#r&%xbw0yQkm1bTh^BW2tIb}{XsYO zj~L&rX)^X@UU%wE>;Ov9c{rY+T5+M}seAy-n7Er6$Piv+q^uSoZ#13bE)p{;Vw~Jr i%8)jl*h1d``bu)H_98jx`qwCDaUG3QI(lo)JO2UVUb^}K literal 0 HcmV?d00001 diff --git a/tonysEncryption/__pycache__/vigenereTable.cpython-39.pyc b/tonysEncryption/__pycache__/vigenereTable.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0600d1625d6f98ca78b034a605f78cfb6c64ba2d GIT binary patch literal 1960 zcmbtVO?MPU6s@oB>3oklAc+W$iXWo}5foxXL=yx=17;El?I2F3DoK+`&rEd<$;56q z!E^i%96iaBoeMYq2Y*3tUGW!Kd8;O3f=4&@oUZD6?^Sobd+&Qw8ye~-xPD*!E%Na6 zhh6NyI2IRiCo>o%k+eZVB3Vc!m*PGNne?QOnahFUH~ck9Od^-7&u``#5`_Ha+*P8t{_&1gzy$n9drQo2J@ zCfP2_Xgf$rN{^6?r+kHG!cfCfzK!FJk!_0jlbM%_)Eg&KjFZgYd*+h-z{W}HV`m{1 zJ3KAy;(+bRRN#o-?BhG9-Z_2d-S^I(n|!~vRF`UbWi`6H)>x05t+q}~=ibI z{JMJkn>*irmuBCWa`MRLtL;!0c|ogIqgGeBr)%+w%6UV@xnFCwR4mIuI9OSYmQ56| z+-z!@2ldsOHcBVCuutJYVz7pHuDOwWrnb~jIgLVL)OsuQW3>VML!yW9smF`;sp>+4 zz17LdQ)f<}tFyF@RK24k(_M%oQ#H-Fn_P<}HKxS1Y-z0Rz6?>fNsuP_>t zf;)^5&6?0tDNX4)l3B~&cB0{zdp64@v_LHT+cbkVGH&=^-fadQgqeV5=s4LCPzjH~YCe*5T1r<`T`Obh(>`3e7sXO-mV?|+j0SZ%UsGK@09V)t#wyOJ2W=>? zHyb&|fL`htzRp8x}b`gqpki1>FF zeu4J@+W&)v-g{gvE@lGw0(ICd=C(ddsL6lgy$rlP;QeEJ8D1d0kF|njz_9}s90PNf z0bRtQ^)ndCfwt;x8z;lE7y4)?D`r*q*{u#1tE{lkhF!Hn zd^-67SKKwDuBq+dD^aT(6}Ad$E#@AHfxEz zB!3_zGJHUO5;m$`gxz!h5(Ihrvs8ef7Mm( Date: Mon, 23 Mar 2026 10:50:30 -0400 Subject: [PATCH 09/11] hash --- tonysEncryption/decrypt.py | 2 +- tonysEncryption/hash.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tonysEncryption/decrypt.py b/tonysEncryption/decrypt.py index 7501bf0..4721012 100644 --- a/tonysEncryption/decrypt.py +++ b/tonysEncryption/decrypt.py @@ -1,4 +1,4 @@ -from encrypt import * +from hash import * diff --git a/tonysEncryption/hash.py b/tonysEncryption/hash.py index e69de29..a7afa5c 100644 --- a/tonysEncryption/hash.py +++ b/tonysEncryption/hash.py @@ -0,0 +1,22 @@ +from encrypt import * +import math + +def rasePower(ascciArr, exponent): + convertedValues = [] + for val in ascciArr: + convertedValues.append(math.pow(val, exponent)) + + return convertedValues + +def modulus(arr, val): + convertedValues = [] + for num in arr: + convertedValues.append(num % val) + + return convertedValues + +def hash(word): + convertedWord = toAscii(word) + convertedWord = rasePower(convertedWord, 999) + convertedWord = modulus(convertedWord, 364) + return convertedWord From 6eeaddb5661702efaba2bd07eb623950dc04084c Mon Sep 17 00:00:00 2001 From: von9880 Date: Mon, 23 Mar 2026 10:50:40 -0400 Subject: [PATCH 10/11] hash --- .../__pycache__/decrypt.cpython-39.pyc | Bin 1678 -> 1675 bytes .../__pycache__/hash.cpython-39.pyc | Bin 0 -> 740 bytes tonysEncryption/main.py | 12 +++++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tonysEncryption/__pycache__/hash.cpython-39.pyc diff --git a/tonysEncryption/__pycache__/decrypt.cpython-39.pyc b/tonysEncryption/__pycache__/decrypt.cpython-39.pyc index 4a052e632cf859871f0019830dd4fce6350c7ec8..550d35b3432188a7f851604638eff14da01e0226 100644 GIT binary patch delta 33 ncmeCnB^Ol|luWi_3j_e2ya|o~ diff --git a/tonysEncryption/__pycache__/hash.cpython-39.pyc b/tonysEncryption/__pycache__/hash.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50887cf1ada5f4326d94b97fbe78e27ab2b7c368 GIT binary patch literal 740 zcmZWm!EV$r5cSyE##>lG74*V|1D7C#5J;#(2vM~aoED@~kfLx%V~e$vjljmy%eqjEy`tkDl2S}T z$=(OcOGrTp6@6nVR|B;{R;XA>vXSD4EE)cy43 zXP>qgqUC4I!x?Wy3+MbCfPIlI!Ck;O5#2^!*Sb<&G|l~_6SbWsQ7Us+6lNDOmHKOK zD_!~SW?`!njb5t{dD&>!iIcp%U^t|5zuy+mvm>X`Wji~MpFVk(?c1W6Qku(N8~>&` z&JIfB_1^rL-sqx1P+#OT}&TDUMl}&Otc~sB4A?8lMvono>o0Fs%L?Gcd z$7|&OM}I)Up8h>@R`j=)^aJ&6c10ZpJxZX*Cb}X=#83jm5K~b#)1KB+g>826)T*Xz zT&TU)%`J}CDN+EbO9_h!_^WO_YuPC*z(WfPPC0p;JRZCjXs=>yeo}@h2__L~?Cq{A zjOmH?_z6#=nMKu&R!jIu*MFOg!t}PN^xqC8Y|@7}D3T1)STDznVN_Sx{qHrTuutqc T%NIRq{W7rYAtgvIV;TPe&W@Kh literal 0 HcmV?d00001 diff --git a/tonysEncryption/main.py b/tonysEncryption/main.py index e134a8f..2ac6273 100644 --- a/tonysEncryption/main.py +++ b/tonysEncryption/main.py @@ -22,12 +22,22 @@ def main(): decryptedWord = decryptWithTable(encryptedWord, superSecretKey) print() - print("------ENCRYPTING WITH VIGENERE TABLE------") + print("------ENCODING WITH VIGENERE TABLE------") print() print("encrypted string: " + encryptedWord) print("decrypted string: " + decryptedWord) + #hashing + encryptedWord = hash(inputWord) + + print() + print("------HASHING------") + print() + print("encrypted string: " + str(encryptedWord)) + + + main() From b37bef25cb1906b6fa0c3259e52b24fc87a90482 Mon Sep 17 00:00:00 2001 From: von9880 Date: Tue, 24 Mar 2026 10:39:42 -0400 Subject: [PATCH 11/11] hashing --- .../__pycache__/decrypt.cpython-39.pyc | Bin 1675 -> 1678 bytes .../__pycache__/hash.cpython-39.pyc | Bin 740 -> 808 bytes tonysEncryption/decrypt.py | 2 +- tonysEncryption/hash.py | 16 ++++++++++------ tonysEncryption/main.py | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tonysEncryption/__pycache__/decrypt.cpython-39.pyc b/tonysEncryption/__pycache__/decrypt.cpython-39.pyc index 550d35b3432188a7f851604638eff14da01e0226..a6faa85f5d8d9a7705be594a15bd7616e085f87c 100644 GIT binary patch delta 407 zcmeC??c?Q5GzbNGvb6H}}N`@kiiI2({ zxh6+4h6=C)l^1cq3C_v;7-boGCf{MK=SCJyV^U=ln%u+WZq5f(tI1Nt3Z$YqiZe3P zN*r@bZt=tI2}{f=O)W0MFqey2g;8X)J~Jz$3@=dcOR(w8Ad4A6To9qjTEsUwfF)8* z5Xgz*Ny^MiEUFAHDay=CFA@L>-D1o{aq4*%D@N(bT&%GcVj$gYMbaRBY?)vm7YPA5 zMIs=A2Sk7ZMw26oCp9m*vH%($QIqGhdP+y}rlckp!39yQU}iJ4h++ro0m*~SfS86b U9AsyaEQmma7nsF4Ig?EZ0Ihaf3;+NC delta 404 zcmeCp3?djoTo9qjTEsg!fF)8* z0LY2rNy^MiEUFAHDay=CFX9IZ-D1o{aq4*%D@Mu5T&%GcA|TytMUo(WY?)vm7YPD6 zMM5Bg8$@sd2~CbDp47bL$^uw;OrFo`DSeAKB{jJSE{I|UGn=95EtZVL;ta3>5Tg(# UgDfnP1rdnA0<$!Ts zHB2SUHO$S7<_xt=g(@JUHCg;#CIc0}tOpXefZQndl6=SFZlDO*hFi?VB}G6P zmh$|flqlZh{JgT%qLS2Ei*4M2gEGm0BPWa6Cl6c;&8}FEY1K)3jw*sd_aPM ok%N&72w8wMA7c?nT$445JtZ}{sIs7>h!x03*j*$vc@vWn0P8hBG5`Po delta 261 zcmZ3%_Jox;k(ZZ?0SH8c4`xbl