Skip to content
 
 

Repository files navigation

Crypto 101: the book

中文自动翻译扩展(本仓库新增)

本仓库在原始 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"

如何构建我已提交的中文翻译版本(zh_CN)

# 推荐:使用 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"
https://github.com/crypto101/book/actions/workflows/ci.yml/badge.svg?branch=master

This is the source repository for Crypto 101, the introductory book about cryptography by lvh.

License

See the LICENSE file.

Translations

For now, crypto101 is only available in english, but you can help translate it into your own language.

Building

Run make book in the root directory of the repository to convert the source files into rendered versions of all supported formats.

Dependencies

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 epub

YOUR_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.

About

使用AI自动翻译原作Crypto 101

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages