Boc Assignment 1
Boc Assignment 1
Assignment 1
You can use the following online tool for this question: https://crypto.interactive-maths.com/columnar-
transposition-cipher.html
"GTGYIGSIVANTIGRMFNONAHESONIIONRLBNIVTWLLMETRELIVLNNELGISEYEAENDEATRLNETEFIURNEIELSAL"
"Z OLMT GRNV ZTL, RM Z TZOZCB UZI, UZI ZDZB... RG RH Z WZIP GRNV ULI GSV IVYVOORLM. ZOGSLFTS
GSV WVZGS HGZI SZH YVVM WVHGILBVW, RNKVIRZO GILLKH SZEV WIREVM GSV IVYVO ULIXVH UILN GSVRI
SRWWVM YZHV ZMW KFIHFVW GSVN ZXILHH GSV TZOZCB. VEZWRMT GSV WIVZWVW RNKVIRZO HGZIUOVVG, Z TILFK
LU UIVVWLN URTSGVIH OVW YB OFPV HPBDZOPVI SZH VHGZYORHSVW Z MVD HVXIVG YZHV LM GSV IVNLGV RXV
DLIOW LU SLGS. GSV VERO OLIW WZIGS EZWVI, LYHVHHVW DRGS URMWRMT BLFMT HPBDZOPVI, SZH WRHKZGXSVW
GSLFHZMWH LU IVNLGV KILYVH RMGL GSV UZI IVZXSVH LU HKZXV..."
You can use the following online tool for this question: https://www.101computing.net/mono-alphabetic-
substitution-cipher/
1
Problem 3: Affine Cipher Encryption and Decryption (25 points)
Affine ciphers are a type of substitution cipher with the encryption function:
E(x) = (a · x + b) mod 26
where a and b are the keys and x is the numeric equivalent of a letter in the alphabet.
You can use the following online tool for this question: https://cryptii.com/pipes/affine-cipher
2
constructor(address _tenant, address _landlord, uint _rentAmount,
uint _dueDate, uint _penaltyAmount) {
tenant = _tenant;
landlord = _landlord;
rentAmount = _rentAmount;
dueDate = _dueDate;
penaltyAmount = _penaltyAmount;
isPaid = false;
}
3
Problem 5.4 (8 points)
Identify one logical flaw in the given pseudocode and explain how it could cause unintended behavior in the
contract. (Hint: Think about the situation when a penalty is applied, and rent is paid late.)