Move to pystitcher
This commit is contained in:
parent
a3e1cefaf4
commit
21250cf83d
|
@ -1,8 +1,9 @@
|
||||||
FROM debian:10-slim
|
FROM python:3-alpine
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
mkdir -p /usr/share/man/man1/ && \
|
mkdir -p /usr/share/man/man1/ && \
|
||||||
apt-get install --yes pdftk wget ca-certificates && \
|
apt-get install --yes wget ca-certificates && \
|
||||||
|
pip install pystitcher && \
|
||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
WORKDIR /security-engineering-ebook
|
WORKDIR /security-engineering-ebook
|
||||||
|
|
38
README.md
38
README.md
|
@ -10,45 +10,11 @@ The e-book version is available now for $42 from [Wiley](https://www.wiley.com/e
|
||||||
|
|
||||||
## Chapters
|
## Chapters
|
||||||
|
|
||||||
See `titles.txt` for the bookmark titles used by the script.
|
See `book.md` for the bookmark titles used by the script.
|
||||||
|
|
||||||
- Preface*
|
|
||||||
- Chapter 1: What is Security Engineering?
|
|
||||||
- Chapter 2: Who is the Opponent?*
|
|
||||||
- Chapter 3: Psychology and Usability
|
|
||||||
- Chapter 4: Protocols
|
|
||||||
- Chapter 5: Cryptography
|
|
||||||
- Chapter 6: Access Control
|
|
||||||
- Chapter 7: Distributed Systems
|
|
||||||
- Chapter 8: Economics
|
|
||||||
- Chapter 9: Multilevel Security
|
|
||||||
- Chapter 10: Boundaries
|
|
||||||
- Chapter 11: Inference Control*
|
|
||||||
- Chapter 12: Banking and Bookkeeping
|
|
||||||
- Chapter 13: Physical Protection
|
|
||||||
- Chapter 14: Monitoring and Metering
|
|
||||||
- Chapter 15: Nuclear Command and Control
|
|
||||||
- Chapter 16: Security Printing and Seals
|
|
||||||
- Chapter 17: Biometrics
|
|
||||||
- Chapter 18: Physical Tamper Resistance
|
|
||||||
- Chapter 19: Side Channels*
|
|
||||||
- Chapter 20: Advanced Cryptographic Engineering*
|
|
||||||
- Chapter 21: Network Attack and Defence
|
|
||||||
- Chapter 22: Phones*
|
|
||||||
- Chapter 23: Electronic and Information Warfare
|
|
||||||
- Chapter 24: Copyright and DRM
|
|
||||||
- Chapter 25: Taking Stock*
|
|
||||||
- Chapter 26: Surveillance or Privacy?*
|
|
||||||
- Chapter 27: Secure Systems Development
|
|
||||||
- Chapter 28: Assurance and Sustainability
|
|
||||||
- Chapter 29: Beyond 'Computer Says No'
|
|
||||||
- Bibliography*
|
|
||||||
|
|
||||||
Chapters marked with \* are available as sample chapters.
|
|
||||||
|
|
||||||
## How to generate the book?
|
## How to generate the book?
|
||||||
|
|
||||||
Run `./generate.sh`. You will need `pdftk`, and `wget` installed. Alternatively, you can run it using Docker.
|
Run `./generate.sh`. You will need `pystitcher`, and `wget` installed. Alternatively, you can run it using Docker.
|
||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
title: Security Engineering — Third Edition
|
||||||
|
author: Ross Anderson
|
||||||
|
|
||||||
|
# Security Engineering
|
||||||
|
|
||||||
|
[Cover](cover.pdf)
|
||||||
|
[Preface](SEv3-pref-May16.pdf)
|
||||||
|
[1. What is Security Engineering?](SEv3-ch1-7sep.pdf)
|
||||||
|
[2. Who is the Opponent?](SEv3-ch2-7sep.pdf)
|
||||||
|
[3. Psychology and Usability](SEv3-ch3-7sep.pdf)
|
||||||
|
[4. Protocols](SEv3-ch4-7sep.pdf)
|
||||||
|
[5. Cryptography](SEv3-ch5-7sep.pdf)
|
||||||
|
[6. Access Control](SEv3-ch6-7sep.pdf)
|
||||||
|
[7. Distributed Systems](SEv3-ch7-7sep.pdf)
|
||||||
|
[8. Economics](SEv3-ch8-7sep.pdf)
|
||||||
|
[9. Multilevel Security](SEv3-ch9-7sep.pdf)
|
||||||
|
[10. Boundaries](SEv3-ch10-7sep.pdf)
|
||||||
|
[11. Inference Control](SEv3-ch11-7sep.pdf)
|
||||||
|
[12. Banking and Bookkeeping](SEv3-ch12-7sep.pdf)
|
||||||
|
[13. Physical Protection](SEv3-ch13-7sep.pdf)
|
||||||
|
[14. Monitoring and Metering](SEv3-ch14-7sep.pdf)
|
||||||
|
[15. Nuclear Command and Control](SEv3-ch15-7sep.pdf)
|
||||||
|
[16. Security Printing and Seals](SEv3-ch16-7sep.pdf)
|
||||||
|
[17. Biometrics](SEv3-ch17-7sep.pdf)
|
||||||
|
[18. Physical Tamper Resistance](SEv3-ch18-7sep.pdf)
|
||||||
|
[19. Side Channels](SEv3-ch19-7sep.pdf)
|
||||||
|
[20. Advanced Cryptographic Engineering](SEv3-ch20-7sep.pdf)
|
||||||
|
[21. Network Attack and Defence](SEv3-ch21-7sep.pdf)
|
||||||
|
[22. Phones](SEv3-ch22-7sep.pdf)
|
||||||
|
[23. Electronic and Information Warfare](SEv3-ch23-7sep.pdf)
|
||||||
|
[24: Copyright and DRM](SEv3-ch24-7sep.pdf)
|
||||||
|
[25: Taking Stock](SEv3-ch25-7sep.pdf)
|
||||||
|
[26. Surveillance or Privacy?](SEv3-ch26-7sep.pdf)
|
||||||
|
[27. Secure Systems Development](SEv3-ch27-7sep.pdf)
|
||||||
|
[28. Assurance and Sustainability](SEv3-ch28-7sep.pdf)
|
||||||
|
[29. Beyond “Computer Says No”](SEv3-ch29-7sep.pdf)
|
||||||
|
[Bibliography](SEv3-bib-7sep.pdf)
|
47
generate.sh
47
generate.sh
|
@ -13,7 +13,7 @@ function assert_installed() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_installed wget pdftk
|
assert_installed wget
|
||||||
|
|
||||||
if [[ $@ == *'--download-cover-image'* ]]; then
|
if [[ $@ == *'--download-cover-image'* ]]; then
|
||||||
echo "Downloading cover image"
|
echo "Downloading cover image"
|
||||||
|
@ -34,47 +34,4 @@ echo "Starting PDF download"
|
||||||
wget --timeout=10 --timestamping --input-file "urls.txt"
|
wget --timeout=10 --timestamping --input-file "urls.txt"
|
||||||
echo "All PDFs downloaded"
|
echo "All PDFs downloaded"
|
||||||
|
|
||||||
pdftk cover.pdf ${FILES_LIST[@]} cat output temp.pdf
|
pystitcher book.md
|
||||||
|
|
||||||
echo "PDF files combined"
|
|
||||||
|
|
||||||
if [[ $@ == *'--generate-metadata'* ]]; then
|
|
||||||
assert_installed qpdf
|
|
||||||
echo "InfoBegin" > meta.txt
|
|
||||||
echo "InfoKey: Title" >> meta.txt
|
|
||||||
echo "InfoValue: Security Engineering — Third Edition" >> meta.txt
|
|
||||||
|
|
||||||
echo "InfoBegin" >> meta.txt
|
|
||||||
echo "InfoKey: Author" >> meta.txt
|
|
||||||
echo "InfoValue: Ross Anderson" >> meta.txt
|
|
||||||
## We start from page 2 because first is cover and it is not included in urls.txt
|
|
||||||
PAGE_NUM=2
|
|
||||||
echo "BookmarkBegin" >> meta.txt
|
|
||||||
echo "BookmarkTitle: Cover" >> meta.txt
|
|
||||||
echo "BookmarkLevel: 1" >> meta.txt
|
|
||||||
echo "BookmarkPageNumber: 1" >> meta.txt
|
|
||||||
|
|
||||||
chapter_id=0
|
|
||||||
readarray -t TITLES < titles.txt
|
|
||||||
while IFS= read -r line
|
|
||||||
do
|
|
||||||
FILENAME=$(basename "$line")
|
|
||||||
PAGES=$(qpdf --show-npages "$FILENAME")
|
|
||||||
BOOKMARK_TITLE="${TITLES[$chapter_id]}"
|
|
||||||
|
|
||||||
echo "BookmarkBegin" >> meta.txt
|
|
||||||
echo "BookmarkTitle: $BOOKMARK_TITLE" >> meta.txt
|
|
||||||
echo "BookmarkLevel: 1" >> meta.txt
|
|
||||||
echo "BookmarkPageNumber: $PAGE_NUM" >> meta.txt
|
|
||||||
chapter_id=$((chapter_id+1))
|
|
||||||
PAGE_NUM=$((PAGE_NUM+PAGES))
|
|
||||||
done < "$INPUT_FILE"
|
|
||||||
echo "Metadata updated"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Bookmarks attached to PDF"
|
|
||||||
|
|
||||||
pdftk temp.pdf update_info meta.txt output $FINAL_PDF
|
|
||||||
rm temp.pdf
|
|
||||||
|
|
||||||
echo "PDF File generated: $FINAL_PDF"
|
|
||||||
|
|
31
titles.txt
31
titles.txt
|
@ -1,31 +0,0 @@
|
||||||
Preface
|
|
||||||
1. What is Security Engineering?
|
|
||||||
2. Who is the Opponent?
|
|
||||||
3. Psychology and Usability
|
|
||||||
4. Protocols
|
|
||||||
5. Cryptography
|
|
||||||
6. Access Control
|
|
||||||
7. Distributed Systems
|
|
||||||
8. Economics
|
|
||||||
9. Multilevel Security
|
|
||||||
10. Boundaries
|
|
||||||
11. Inference Control
|
|
||||||
12. Banking and Bookkeeping
|
|
||||||
13. Physical Protection
|
|
||||||
14. Monitoring and Metering
|
|
||||||
15. Nuclear Command and Control
|
|
||||||
16. Security Printing and Seals
|
|
||||||
17. Biometrics
|
|
||||||
18. Physical Tamper Resistance
|
|
||||||
19. Side Channels
|
|
||||||
20. Advanced Cryptographic Engineering
|
|
||||||
21. Network Attack and Defence
|
|
||||||
22. Phones
|
|
||||||
23. Electronic and Information Warfare
|
|
||||||
24: Copyright and DRM
|
|
||||||
25: Taking Stock
|
|
||||||
26. Surveillance or Privacy?
|
|
||||||
27. Secure Systems Development
|
|
||||||
28. Assurance and Sustainability
|
|
||||||
29. Beyond “Computer Says No”
|
|
||||||
Bibliography
|
|
Loading…
Reference in New Issue