This shows you the differences between two versions of the page.
|
ic:labs:02 [2023/10/01 23:13] razvan.smadu [Laboratorul 02 - Shift and Vigenère Ciphers] |
ic:labs:02 [2023/10/09 19:15] (current) razvan.smadu |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Prezentarea PowerPoint pentru acest laborator poate fi găsită [[https://drive.google.com/file/d/1rbiXVtSESTDc2rAyaO9oNRNLE3NRw54a/view?usp=sharing|aici]]. | Prezentarea PowerPoint pentru acest laborator poate fi găsită [[https://drive.google.com/file/d/1rbiXVtSESTDc2rAyaO9oNRNLE3NRw54a/view?usp=sharing|aici]]. | ||
| - | Pentru acest laborator, vom avea nevoie de scheletul de cod care se găsește aici: {{:ic:res:lab2_sketch.zip|}}. Puteți lucra acest laborator folosind și platforma Google Colab, accesând [[https://colab.research.google.com/drive/1cwSKaqComBVqYY4VRKVoPPmDsWihVeic?usp=sharing|acest]] link. | + | Puteți lucra acest laborator folosind platforma Google Colab, accesând [[https://colab.research.google.com/github/ACS-IC-labs/IC-labs/blob/main/labs/lab02/lab2.ipynb|acest]] link. |
| + | |||
| + | <hidden> | ||
| + | Pentru acest laborator, vom avea nevoie de scheletul de cod care se găsește aici: {{:ic:res:lab2_sketch.zip|}}. | ||
| Conținutul arhivei: | Conținutul arhivei: | ||
| Line 117: | Line 120: | ||
| def main(): | def main(): | ||
| - | |||
| # Plaintexts | # Plaintexts | ||
| - | s1 = 'floare' | + | s1 = "floare" |
| - | s2 = 'albina' | + | s2 = "albina" |
| - | G = '' # To find | + | G = "" # To find |
| # Obtain crc of s1 | # Obtain crc of s1 | ||
| Line 129: | Line 131: | ||
| x2 = str_2_hex(s2) | x2 = str_2_hex(s2) | ||
| print("x1: " + x1) | print("x1: " + x1) | ||
| - | crc1 = '8E31' # CRC-16 of x1 | + | crc1 = "8E31" # CRC-16 of x1 |
| # Compute delta (xor) of x1 and x2: | # Compute delta (xor) of x1 and x2: | ||
| xd = hexxor(x1, x2) | xd = hexxor(x1, x2) | ||
| print("xd: " + xd) | print("xd: " + xd) | ||
| + | |||
| + | # TODO: | ||
| Line 145: | Line 149: | ||
| Dacă d = 'floare' XOR 'albina', iar C = [C1 | C2] = [m XOR G1 | CRC(m) XOR G2], atunci C1' = C1 XOR d. | Dacă d = 'floare' XOR 'albina', iar C = [C1 | C2] = [m XOR G1 | CRC(m) XOR G2], atunci C1' = C1 XOR d. | ||
| </note> | </note> | ||
| + | </hidden> | ||