本仓库在原始 Crypto 101 项目基础上,新增了中文自动翻译流程(提取 -> 翻译 -> 组装)。
完整流程文档见:
# 1) 提取可翻译模板(.pot)
docker run --rm -v "$(realpath .)":/repo -u "$(id -u)" crypto101:latest make tx_push
# 2) 配置模型 token(示例)
export DEEPSEEK_API_KEY="<your-token>"
# 3) 执行自动翻译(生成/更新 .po)
cd translate
python main_translate.py run --files stream-ciphers ssl-and-tls
# 4) 构建中文输出(回到仓库根目录执行)
cd ..
docker run --rm -v "$(realpath .)":/repo -u "$(id -u)" crypto101:latest ./make-lang zh_CN html
# macOS 如遇默认 entrypoint 参数异常,可用:
docker run --rm --entrypoint /bin/sh -v "$(realpath .)":/repo -u "$(id -u)" crypto101:latest -lc "./make-lang zh_CN html"# 推荐:使用 Docker 直接构建 zh_CN
docker run --rm -v "$(realpath .)":/repo -u "$(id -u)" crypto101:latest ./make-lang zh_CN html latexpdf epub
# macOS 如遇默认 entrypoint 参数异常,可用:
docker run --rm --entrypoint /bin/sh -v "$(realpath .)":/repo -u "$(id -u)" crypto101:latest -lc "./make-lang zh_CN html latexpdf epub"This is the source repository for Crypto 101, the introductory book about cryptography by lvh.
See the LICENSE file.
For now, crypto101 is only available in english, but you can help translate it into your own language.
Run make book in the root directory of the repository to convert the
source files into rendered versions of all supported formats.
Due to the high number of dependencies, using docker is highly recommended:
docker build -t crypto101 docker/
docker run --rm -it -v "$(realpath .)":/repo -u "$(id -u)" crypto101 ./make-lang YOUR_LANGUAGE_CODE html latexpdf epubYOUR_LANGUAGE_CODE must a valid sphinx language code,
like en, fr, ko or zh_CN.
You can find the install procedure for the dependencies for ubuntu and fedora in their dedicated dockerfiles.