-
Notifications
You must be signed in to change notification settings - Fork 15
Cyclic3's guide to CipheyCore (CPP side)
The C++ interface is rather scattered and non-standardised. This is because we only add things to CipheyCore that we can't get done in python with reasonable efficiency, and so it doesn't make sense to have a standardised interface. That being said, it does have a certain structure to it
Interface functions and their trivial implementations go in include/ciphey/ciphers.hpp. The actual implementation for each cipher has its own source file in src/ciphers. Because SWIG is not well-designed for C++, the public type definitions that are exposed to python need to go in their own header file (include/ciphey/ciphers.swig.hxx).
Each cipher has its own namespace, which should have at least:
- a
key_t
type which represents the key for the cipher - a
crack
function that returnsstd::vector<crack_result<key_t>>
-
encrypt
anddecrypt
functions - a
detect
function that returns aprob_t
that represents the likelihood that a ciphertext was created with the cipher (this can take in extra parameters if more information is required
Other functions can exist (such as ones to determine key length)
This has no uniform interface (as it's basically just a bunch of statistical manipulations), and all the functions pretty much do as their name says. I'm not sure how to document these
Yeah this is crap. If you want to contribute to AuSearch, it's probably best to rewrite it from scratch.