Delphinium
No description available
Install / Use
/learn @Pythia3431/DelphiniumREADME
Delphinium
Authors: Gabrielle Beck, Max Zinkus, Matthew D. Green
This code accompanies "Automating the Development of Chosen Ciphertext Attacks" in Usenix Security 2020.
The full version of the paper can be found here.
Running Delphinium
Core Delphinium code can be found in code/sandbox/
In order to use Delphinium to attack a format oracle, the following is required:
- A format, implementing the following functions (see
formats/for examples)checkFormat: implementation of the format predicate which takes a bitvector in the form of an Int and returns 1 or 0 (for True and False, respectively)checkFormatSMT: implementation of the format predicate which operates on solver bit vector objects. This takes the bit vector solver value representing the message, and the solver instance, and returns a solver value representing 1 or 0 (for True and False, respectively)makePaddedMessage: For testing, the plaintext message being recovered- The format file must also contain the following constants:
test_length: the number of bits in a target message- optionally,
num_blocks: The number of blocks of sizetest_lengthwhich make up the target message. Specifyingtest_length = 128is equivalent to specifyingtest_length = 16andnum_blocks = 8
- If the format oracle must be reached over a network, a shim such as the one in
TLSCBC_For_Network_Test/shim.pymust be provided to abstract the network connection, and it must be used intrimmed_test.pyas it is inTLSCBC_For_Network_Test/tls_cbc.pyto replace calls to the example predicate oracle provided inoracle.py
Then, to run, NAME=experiment_name python trimmed_test.py.
experiment_name determines where log files are saved and should be unique and human-readable, e.g. PCKS7_128bits
Arguments:
Required Arguments:
-f --format: Select which format file to use. e.g.formats.PKCS7
Optional Arguments:
--valid: indicates to the solver that the known ciphertext encrypts a validly formatted message. Commonly the case, and can improve performance dramatically for some formats-t --trials: Indicates the number of trials (increasing certainly) to be used in the underlyingMax#SAToracle. Increases malleation string quality with diminishing returns (for tested formats) as the cost of increased runtime-p --procs: The number of cores to use for multiprocessing-w --window: The number of simultaneousMax#SATtests to run for parallelism. Each solver instance receivesprocs / windowcores for per-solver multithreading, andwindowsuch number of instances are launched-i --invert: Begin search at the low-count end of the range rather than the high-count. Useful if you know that the format does not admit any high-quality malleation strings-r --random: Parameter for underlyingMax#SAToracle. Required for stronger formal guarantees, but may increase runtime without improving practical performance-c --cnf: as CNF generation can be expensive, CNFs are logged as output in.cnffiles. If re-running with a format, use this option to re-use the cached CNF and skip initial regeneration--bootstrap: If re-running a partially completed experiment, use this option to re-input the derived oracle queries and their results from a.logfile-q --quiet: Show less output-x --tmp: Use a non-defaulttmpdirectory. Useful if you have a fast disk and are working with a complex format that may generate CNF files too large for thetmpfilesystemh
Extra Dependencies
Some of the functionalities provided by the solver class require the installation of ApproxMC.
Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
