MCPcopy Index your code
hub / github.com/Apress/practical-cryptography-in-python

github.com/Apress/practical-cryptography-in-python @v1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0 ↗ · + Follow
184 symbols 674 edges 46 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Apress Source Code

This repository accompanies Cryptography in Python Source Code by Seth Nielson and Christopher K. Monson (Apress, 2019).

Cover image

Download the files as a zip using the green button, or clone the repository to your machine using Git.

Releases

Release v1.0 corresponds to the code in the published book, without corrections or updates.

Contributions

See the file Contributing.md for more information on how you can contribute to this repository.

Listing Types

There are two types of listings in the book. The first is typical Python code meant to be executed as a Python script. These can be executed directly from the command line with the appropriate configuration as described in Chapter 1.

The other files are representations of Python commands executed in a Python interactive shell. We have included these snippets in files ending with ".pyprompt". Obviously, these cannot be run from the command line but you can copy each individual command into a shell if you would like to re-create the output.

Differences from Listings

The source code herein is not a perfect one-to-one match to source code listings in the book. For one thing, some book listings were shortened or simplified for space constraints or clarity. In other cases, multiple listings within the book are taken from a single file. Occasionally, there is a very small change to the actual code for similar reasons.

Most of the included Python programs also include a simple main function that performs a simplistic sanity check to test that the code is working correctly. It would have been better to use Python's unittest framework but there were a couple of reasons this solution wasn't the default. Most of these programs, if run, will output either "[PASS]" (if everything worked correctly) or "[FAIL]" otherwise. For some, there is an explicit "--auto-tester" value checked at the command line that can be safely ignored.

Prerequisites

While most of the included examples are completely self-contained, there are a few that must be run together or require some special inputs. These prerequisites are listed in the book. If something doesn't seem to work right, make sure that you are following the instructions.

Core symbols most depended-on inside this repo

BROKEN_CBCMAC1
called by 12
src/fake_cbc_mac.py
int_to_bytes
called by 4
src/rsa_oracle_attack.py
load_packet
called by 4
src/simple_kerberos_client.py
dump_packet
called by 3
src/simple_kerberos_tgs.py
load_packet
called by 3
src/simple_kerberos_tgs.py
_find_s
called by 3
src/rsa_oracle_attack.py
dump_packet
called by 3
src/simple_kerberos_client.py
dump_packet
called by 3
src/simple_kerberos_as.py

Shape

Method 90
Function 66
Class 28

Languages

Python100%

Modules by API surface

src/enc_speed_test.py23 symbols
src/rsa_oracle_attack.py20 symbols
src/simple_kerberos_client.py19 symbols
src/simple_kerberos_tgs.py9 symbols
src/rsa_simple.py9 symbols
src/http_proxy.py9 symbols
src/simple_kerberos_as.py8 symbols
src/caesar_control.py8 symbols
src/rsa_common_modulus.py6 symbols
src/aes_ctr.py6 symbols
src/aes_cbc_manager.py6 symbols
src/rsa_exchange.py5 symbols

For agents

$ claude mcp add practical-cryptography-in-python \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact