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.

_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.


  • 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.
_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.


  • pixel::RGB: Pixel value with r, g, and b components.
  • key::Int64: The key.


  • pixel::RGB: Substituted pixel.