Encryption/decryption algorithms
Developer documentation for encryption and decryption algorithms.
These lower level APIs can also be used by the users, but are not recommended for beginners.
ChaoticEncryption._substitution
— Method_substitution(image, keys, type; path_for_result="./encrypted.png")
Performs substitution encryption/decryption on a given image with the given keys.
See substitution_encryption
and substitution_decryption
for more details.
Arguments
image::Array{RGB{N0f8},2}
: A loaded image.keys::Array{Int64, 1}
: Keys for encryption.type::Symbol
: Can be:encrypt
or:decrypt
.save_img::Bool=false
: Save the resultant image.path_for_result::String
: The path for storing the encrypted image.inplace::Bool
: Perform substitution on the provided image.debug::Bool
: Print debug output.
ChaoticEncryption._substitute_pixel
— Method_substitute_pixel!(pixel::RGB, key::Int64)
Returns the pixel after XORing the R, G, and B values with the key. Specifically developed to return an Array
(or the complete image) of XORed RGB values in one go.
See _substitution
for more details.
Arguments
pixel::RGB
: Pixel value with r, g, and b components.key::Int64
: The key.
Returns
pixel::RGB
: Substituted pixel.