This shows you the differences between two versions of the page.
ac:laboratoare:01 [2017/09/21 15:09] marios.choudary created |
ac:laboratoare:01 [2024/12/13 10:54] (current) dimitrie.valu |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | TODO | + | ===== Lab 01 - Introduction ===== |
+ | |||
+ | This laboratory will serve as an introduction to Python and the Caesar cipher. To solve the lab, open [[https://colab.research.google.com/drive/18Zq4zPlsEWWasOP8fKdOqo9aKFtlYMnW?usp=sharing|this Colab notebook]] and copy it into your own drive for persistence. Do so by going to ''%%File%%'' -> ''%%Save a copy in Drive%%''. | ||
+ | |||
+ | <hidden> | ||
+ | The solution for the last exercise is: | ||
+ | |||
+ | <code python> | ||
+ | C1 = "000100010001000000001100000000110001011100000111000010100000100100011101000001010001100100000101" | ||
+ | C2 = "02030F07100A061C060B1909" | ||
+ | |||
+ | key = "abcdefghijkl" | ||
+ | |||
+ | # Solve here | ||
+ | P1 = bin_2_str(bitxor(str_2_bin(key), C1)) | ||
+ | print(P1) | ||
+ | |||
+ | P2 = bin_2_str(bitxor(str_2_bin(key), hex_2_bin(C2))) | ||
+ | print(P2) | ||
+ | </code> | ||
+ | |||
+ | The output should be: | ||
+ | <code> | ||
+ | programatori | ||
+ | calculatoare | ||
+ | </code> | ||
+ | </hidden> |