liveBook · Manning

Encryption

As explained in AI-Powered Developer: Build software with ChatGPT and Copilot

Encryption is the cryptographic transformation of readable data into an encoded form that unauthorized parties cannot readily interpret.

Encryption transforms readable plaintext into ciphertext so that only someone with the correct key can recover the original data. It protects sensitive information at rest and in transit, but works best alongside access controls, audits, secure backups, and user education. section 8.4.1 section 8.4.2

Apply encryption to practical application boundaries:

  • For data at rest, encrypt sensitive values before placing them in a database, then decrypt them only after retrieval. section 8.4.2
  • For data in transit, serve REST applications over HTTPS and evaluate authentication, authorization, and endpoint protections. section 8.4.3
  • Choose deliberately among symmetric and asymmetric encryption, block and stream ciphers, and established algorithms such as AES, RSA, and ECC. section 8.4.2
  • Review generated implementations rather than treating them as production-ready: protect keys, test recovery, plan backups and rotation, and account for performance and latency. section 8.4.3

Encrypting a secret in Python

A practical AI-assisted starting point uses Python's cryptography library and Fernet: generate a key, create a cipher, encrypt byte-string plaintext, and decrypt the ciphertext with the same key. Adapt the example only after checking key storage, error handling, testing, and the requirements of the surrounding application.

How AI-Powered Developer: Build software with ChatGPT and Copilot covers it

How deep it goes
Explains encryption categories, algorithm choices, Python implementation, database storage, key management, and operational trade-offs.
Examples
Demonstrates Python Fernet code, SQLite3 storage, Flask REST endpoint protection, and the Ashley Madison breach.
What it assumes
Assumes application-development familiarity while introducing encryption concepts, algorithm distinctions, key handling, and implementation cautions.
What you can do after
Apply it via Python and HTTPS while reviewing key handling, database integration, security layers, and performance consequences.
How it connects
Connects encryption with symmetric encryption, asymmetric encryption, hashing, public key infrastructure, HTTPS, authentication, authorization, and key management.

Also explained in

Compare how 16 books explain encryption →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Developer: Build software with ChatGPT and Copilot. The section links point to the parts of the book it draws on.