-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional documentation; copy results
- Loading branch information
Showing
3 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,56 @@ | ||
# Marvin tool-kit integration | ||
This document describes the procedure for replicating the analysis for the Marvin attack. This analysis is best done on a container for reproducibility. | ||
|
||
**TL;DR**: | ||
```bash | ||
docker build -t marvin:latest . | ||
docker run --rm \ | ||
|
||
# Compile RustCrypto/RSA 0.9 then Run the analysis using RSA 2048 and with | ||
# 100000 repeat | ||
docker run -d --rm \ | ||
--name marvin \ | ||
marvin:latest | ||
|
||
# Use "docker logs -f marvin" to read live output | ||
``` | ||
|
||
## Adjusting analysis parameters | ||
For more help on the options pass in the `-h` flag in the `docker run` command: | ||
|
||
``` | ||
docker run ... marvin:latest -h | ||
``` | ||
|
||
There are two main parameters of the analysis: RSA key size and the number of repetitions during ciphertext generation. | ||
|
||
RSA key size is specified through `-s <1024|2048|4096>`. The number of repetition is specified through `-n <num>`. A larger repetition number will increase the confidence of the analysis, but will make the analysis take longer. The default key size is 2048 and the default repetition count is 100,000. | ||
|
||
```bash | ||
# Run analysis for RSA 4096 with 1 million repetition | ||
docker run -d --rm \ | ||
--name marvin \ | ||
-v /home/ec2-user/RSA/marvin-toolkit/Cargo.toml:/home/rustcrypto/marvin-toolkit/example/rust-crypto/Cargo.toml \ | ||
marvin:latest -s 4096 -n 1000000 | ||
``` | ||
|
||
## Extracting keys, ciphertexts, and analysis results (WIP) | ||
After the analysis is done, the generate keys, ciphertexts, and the analysis outputs are all copied into the directory `/home/rustcrypto/marvin-toolkit/outputs`. To extract and preserve these artifacts, mount a volume into this directory, such as using a bind mount: | ||
|
||
```bash | ||
HOST_OUTPUT_DIR="..." | ||
mkdir -p ${HOST_OUTPUT_DIR} | ||
chmod a+rw ${HOST_OUTPUT_DIR} | ||
|
||
# Mount | ||
docker run -d --rm --name "marvin" \ | ||
-v ${HOST_OUTPUT_DIR}:/home/rustcrypto/marvin-toolkit/outputs \ | ||
marvin:latest | ||
``` | ||
|
||
## Compile test harness with custom `Cargo.toml` | ||
The test harness is compiled at container run-time, so a custom `Cargo.toml` can be passed into the container at runtime to compile the test harness using custom versions of `RustCrypto/RSA` and/or `RustCrypto/crypto-bigint`: | ||
|
||
```bash | ||
docker run -d --rm --name "marvin" \ | ||
-v /host/path/Cargo.toml:/home/rustcrypto/marvin-toolkit/example/rust-crypto/Cargo.toml \ | ||
marvin:latest | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters