Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Assignment 1/210453/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is an example of Vignere Cipher where polyalphabetic substitution cipher is used to determine the shift for each character. Now, to find the key word, we inspect the website google.com After several attemppts to get meaningful sentence, we find the key: "rnmpx" as the key from the button "I'm Feeling Lucky" 's division class.

The final password is: congraulations, you have triumphed, emerged victorious, defeating the unfathomable forces of encryption. your skills, your relentless pursuit of knowledge, and your unwavering determination have led you to this moment, this glorious moment of triumph. your key to sucess and the password is the_fun_has_only_begun.
20 changes: 20 additions & 0 deletions Assignment 1/210453/code
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
str = "tbzvoclymifqef, kdr jriq ioklzbwbf, vzqgdgu iurqqivajp, fvsqpqket fwb wesmieqdnnab hfeotp qw rzroaggudk. afhd hhkcye, nlwi eqabpkyqhp rleejfv fs wclycrpvb, ceq kdrt laipsgivzv agkrdbfprgudk jriq abf pbg il vyve blovaf, iekj txdokfhe blovaf dc vivgbmj. pbgg hgp ga hrevfe pkf kuq exujjaga kj gtt_cwe_umh_lpcl_ntdwe."
keyword = "rnmpxc"
x = 0
result = ""

for i in range(len(str)):
if str[i].islower():
result += chr((ord(str[i]) - ord(keyword[x]) + 26) % 26 + ord('a'))
x += 1
if x == len(keyword):
x = 0
elif str[i].isupper():
result += chr((ord(str[i].lower()) - ord(keyword[x]) + 26) % 26 + ord('A'))
x += 1
if x == len(keyword):
x = 0
else:
result += str[i]

print(result)
1 change: 1 addition & 0 deletions Assignment 2/210453/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BREAKER OF THIS CODE WILL BE BLESSED BY THE SQUEAKY SPIRIT RESIDING IN THE HOLE GO AHEAD, AND FIND A WAY OF BREAKING THE SPELL ON HIM CAST BY THE EVIL JAFFAR. THE SPIRIT OF THE CAVE MAN IS ALWAYS WITH YOU. FIND THE MAGIC WAND THAT WILL LET YOU OUT OF THE CAVES. IT WOULD MAKE YOU A MAGICIAN, NO LESS THAN JAFFAR! SPEAK THE PASSWORD THE_MAGIC_OF_WAND TO GO THRHGTO.U
80 changes: 80 additions & 0 deletions Assignment 2/210453/code
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main() {
string cipherText = "qmnjvsa nv wewc flct vprj tj tvvplvl fv xja vqildhc "
"xmlnvc nacyclpa fc gyt vfvw. fv wgqyp, pqq pqcs y wsq "
"rx qmnjvafy cgv tlvhf cw tyl aeuq fv xja tkbv cqnsqs. "
"lhf avawnc cv eas fuqb qvq tc yllrqr xxwa cfy. psdc uqf "
"avrqc gefq pyat trac xwv taa wwd dv eas flcbq. vd trawm "
"vupq quw x decgqcwt, yq yafl vlqs yqklhq! snafq vml "
"lhvqpawr nqg_vfusr_ec_wawy qp fn wgawdgf.";

string decryptedText;
int index = 0;
while (index < cipherText.length()) {
char characters[5];
string interstitials[5];
for (int curIndex = 0; curIndex < 5; curIndex++) {
if (isalpha(cipherText[index])) {
characters[curIndex] = cipherText[index];
// Take all the non-letters with it too
while (!isalpha(cipherText[index + 1]) && index < cipherText.length() - 1)
interstitials[curIndex] += cipherText[++index];
}
index++;
}
// Concatenate in new order
decryptedText += characters[3] + interstitials[0] + characters[2] + interstitials[1] +
characters[4] + interstitials[2] + characters[0] + interstitials[3] + characters[1] + interstitials[4];
}

cipherText = decryptedText;
string substitutionRules[] = { "Ow", "Aq", "Ta", "Sl", "Ph", "Ev", "Hf", "Gg", "Ud", "Rn", "Km", "Wr", "Dp", "Ic", "Ny", "Bj",
"Fs", "Ce", "Lt", "Yx", "Qi", "Mu", "Jk", "Vb" };

for (string rule : substitutionRules) {
size_t pos = cipherText.find(rule[1]);
while (pos != string::npos) {
cipherText.replace(pos, 1, string(1, rule[0]));
pos = cipherText.find(rule[1], pos + 1);
}
}

// Print
int position = 0;
bool afterFullStop = false;
bool replaceSpaces = false;
for (char c : cipherText) {
if (!isalpha(c)) {
if (afterFullStop) {
cout << c;
} else {
if (c == '.') {
afterFullStop = true;
replaceSpaces = true;
} else if (c == '_') {
cout << ' ';
} else {
if (replaceSpaces) {
cout << " " << c;
replaceSpaces = false;
} else {
cout << c;
}
}
}
continue;
}
cout << c;
position++;
if (position == 5) {
position = 0;
}
}

return 0;
}
1 change: 1 addition & 0 deletions Assignment 3/210453/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Final Answer: Encryption After initial permutation FF10C86D00F8EAC1 Round 1 00F8EAC1 953AB64D A0B6826F6208
Loading