
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
github.com/pekingducky/cryptography1-week2-go
We will use Python to create a program that will implement encryption/decryption systems, one using AES in CBC mode and another using AES in counter mode (CTR).
In both encryption/decryption systems, the 16-byte encryption IV is chosen at random and is prepended to the ciphertext. For CBC encryption we use the PKCS5 padding scheme discussed in the lecture (14:04). We have been asked to implement both encryption and decryption, but we will only be tested the decryption function.
In the following questions (1-4) we are given an AES key and a ciphertext (both are hex encoded). Our goal is to recover the plaintext and enter it in the input boxes provided below. For an implementation of AES we may use an existing crypto library such as PyCrypto (Python), Crypto++ (C++), or any other. While it is fine to use the built-in AES functions, as learning experience, we must implement CBC and CTR modes ourselves.
Question 1:
CBC key: 140b41b22a29beb4061bda66b6747e14
CBC Ciphertext 1: 4ca00ff4c898d61e1edbf1800618fb2828a226d160dad07883d04e008a7897ee2e4b7465d5290d0c0e6c6822236e1daafb94ffe0c5da05d9476be028ad7c1d81
Question 2:
Question 3:
Question 4:
Result 1: Basic CBC mode encryption needs padding.
Result 2: Our implementation uses rand. IV
Result 3: CTR mode lets you build a stream cipher from a block cipher.
Result 4: Always avoid the two time pad!
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.