printcipher48 v0.1.0 Printcipher48 View Source

Module to encrypt en decrypt a payload with printcipher48

Link to this section Summary

Functions

Decrypt a ciphertext of 6 bytes

Encrypt a plaintext of 6 bytes

Link to this section Functions

Link to this function

decrypt(cyphertext, key, permkey)

View Source

Decrypt a ciphertext of 6 bytes

Params :

  • cyphertext of 6 bytes
  • key of 6 bytes
  • permutation key of 4 bytes Returns the plaintext payload of 6 bytes

Examples

iex> Printcipher48.decrypt(<<235, 74, 249, 94, 125, 55>>, <<194, 136, 149, 186, 50, 123>>, <<105, 210, 205, 182>>)
<<76, 132, 117, 85, 195, 91>>
Link to this function

encrypt(plaintext, key, permkey)

View Source

Encrypt a plaintext of 6 bytes

Params :

  • plaintext of 6 bytes
  • key of 6 bytes
  • permutation key of 4 bytes Returns the encrypted payload of 6 bytes

Examples

iex> Printcipher48.encrypt(<<76, 132, 117, 85, 195, 91>>, <<194, 136, 149, 186, 50, 123>>, <<105, 210, 205, 182>>)
<<235, 74, 249, 94, 125, 55>>