CrackingCodes.Ch23 package

Submodules

CrackingCodes.Ch23.PracticeQuestions module

Chapter 23 Practice Questions

Answers Chapter 23 Practice Questions via Python code.

CrackingCodes.Ch23.PracticeQuestions.main()[source]

CrackingCodes.Ch23.makePublicPrivateKeys module

Public Key Generator

Implements series of functions capable of creating a textbook RSA public/private keypair and saves them to text files.

Note

CrackingCodes.Ch23.makePublicPrivateKeys.generateKey(keySize: int) → tuple[source]

Generate public/private keypair

Creates public/private keys keySize bits in size.

Parameters:keySize – Bit size to make public/private keys.
Returns:Tuples containing the public and private keypair split into their two halves.
CrackingCodes.Ch23.makePublicPrivateKeys.main()[source]
CrackingCodes.Ch23.makePublicPrivateKeys.makeKeyFiles(name: str, keySize: int) → None[source]

Make key files

Creates two files ‘x_pubkey.txt’ and ‘x_privkey.txt’ (where x is the value in name) with the n,e and d,e integers written in them, delimited by a comma.

Parameters:
  • name – Name to append to public/private key files.
  • keySize – Bit size to make public/private keys.
Returns:

None. Key files are created in current working directory.

Note

  • Checks if key files with given name already exist and exits with warning if so.

Module contents