Cryptography.hpp File Reference

Plans regarding building and making available of cryptology software and benchmarks. More...

Go to the source code of this file.

Detailed Description

Plans regarding building and making available of cryptology software and benchmarks.

  • The general term for both design and analysis of systems is "cryptology".
  • This is used throughout in the OKlibrary.
  • "Cryptography" is concerned with the design, "cryptanalysis" with the analysis.
  • However "cryptography" is used by some people (for example the English Wikipedia) to stand for the whole field. This is unfortunate (historically false), but just means we should not use the term "cryptography", but "crytological system" (or so).
  • "Cryptology" is unambigous, standing always for the whole field.
  • At the build-system level, we should have just one file for everything, and thus this file should become "Cryptology.hpp".
New library (replacing Mhash)
  • Crypto++ http://www.cryptopp.com/ seems like a strong library.
    1. Building via "PREFIX=XXX make all test install" yields an error (it uses "GNUmakefile"; version 5.6.1):
      cp: cannot stat `*.so': No such file or directory
      make: *** [install] Error 1
      So the dynamic link-library is not created.
    2. We could ignore it, using only the .a-library.
    3. But better to contact the developers (also for testing how strong the community is; the build-process looks a bit ad-hoc).
Grain of salt
  • Available at http://www.msoos.org/grain-of-salt .
  • Grain of salt is a general system for translating shift register-based stream ciphers.
  • The ciphers already available for translation in grain of salt are:
    • Grain,
    • Trivium,
    • Bivium-B,
    • HiTag2, and
    • Crypto1.
  • This system is written in C++ and allows parts of the cipher to be "optimised" using espresso.
  • This system should be installed and investigated.
  • It should be possible to extend this system to also use our own methods of translating "boxes", as discussed in "Translating stream ciphers using our translations" in Experimentation/Investigations/Cryptography/plans/general.hpp.
Create documentation
Argo DES instances
Kreuzer DES instances
  • In [Algrebraic Attacks using SAT-solvers; Jovanovic and Kreuzer] the authors mention a translation to DES using the ApCoCoA system.
  • We should contact the authors and ask if this translation is available.
DES generator
  • http://disi.unitn.it/~massacci/CryptoSAT/ contains the generator and an update.
  • The sources are in sources/SAT/Des.
  • We need this for comparison (and for historical reasons).
  • Installing the DES generator:
    ExternalSources/builds/SAT/> mkdir Des && cd Des
    ExternalSources/builds/SAT/Des/> tar zxvf ../../../sources/SAT/Des/des2fml-0.9.tgz
    ExternalSources/builds/SAT/Des/> cd des2fml-0.9
    ExternalSources/builds/SAT/Des/des2fml-0.9/> zcat ../../../../sources/SAT/Des/des2fml-0.9-newgcc.diff.gz | patch -p1
    ExternalSources/builds/SAT/Des/des2fml-0.9> make
  • Using the tool:
    • The plaintext, key are available in the files plaintxt and key_des.
    • By default many plaintexts are provided. All but one must be removed if one wants to generate an instance with a single plaintext-ciphertext-pair.
    • Run
      ExternalSources/builds/Des/des2fml-0.9> rounds=1
      ExternalSources/builds/Des/des2fml-0.9> ./des -r${rounds}
      to generate the ciphertext in ciph_text from plaintxt and key_des for ${rounds} rounds.
    • Then run
      ExternalSources/builds/Des/des2fml-0.9> ./des2fml -r${rounds} -p -c -f1
      to generate the file formulae. This contains a CNF but in Dimacs format.
    • Converting formulae to Dimacs:
      ./clausify formulae test.cnf
    • So for example with
      0xe9 0xa6 0x52 0x90 0x90 0x62 0x60 0xf7
      in plaintext, and
      0x1b 0x6c 0x26 0xa7 0x20 0x03 0x3d 0xa2
      in key_des, we get the following:
      ExternalSources/builds/Des/des2fml-0.9> round=3 && ./des -r${round} && ./des2fml -r${round} -p -c -f1 && ./clausify formulae test.cnf
      ############# DES with 3 round/rounds #############
      Key: 1b6c26a720033da2
      Plaintext: e9a65290906260f7
      Ciphertext (after 3 round/rounds): 72fe6cf9cfcebb57
      ####### Block number 1 #######
      Plaintext: e9a65290906260f7
      Ciphertext (after 3 round/rounds): 72fe6cf9cfcebb57
      ExternalSources/builds/Des/des2fml-0.9> OKsolver-O3-DNDEBUG test.cnf
      c sat_status                            1
      c initial_maximal_clause_length         24
      c initial_number_of_variables           1531
      c initial_number_of_clauses             9286
      c initial_number_of_literal_occurrences 25522
      c number_of_initial_unit-eliminations   0
      c number_of_2-clauses_after_reduction   7421
      c running_time(sec)                     8.1
      c number_of_nodes                       266
      c number_of_single_nodes                0
      c number_of_quasi_single_nodes          0
      c number_of_2-reductions                25797
      c number_of_pure_literals               0
      c number_of_autarkies                   0
      c number_of_missed_single_nodes         0
      c max_tree_depth                        10
      c number_of_table_enlargements          0
      c number_of_1-autarkies                 4
      c number_of_new_2-clauses               0
      c maximal_number_of_added_2-clauses     0
      c file_name                             test.cnf
  • What to call the tool?
    • When installing the tool in ExternalSources we must have a name to use for configuration and build files.
    • "Des" is likely too general.
    • Something like "DesMassacci" places a lot of emphasis on the author which we don't do for other packages.
    • "des2fml" is the name of the package as provided by Massacci, however, the question is whether we will remember this.
  • How to use the tool outside of its directory?
    • The executable "des2fml" expects various files to be in the directory it executes in.
    • For example:
      OKlib> ../../ExternalSources/builds/SAT/Des/des2fml-0.9/des2fml -b1 -f1 -r1
      ####### Block number 1 #######
      Error: file ./S-fml/S11 doesn't exist
    • des2fml requires that the files containing the S-box representations (S-fml/SXX) are available, as well as the files containing the plaintext and ciphertext (plaintxt and ciphtxt) in the current directory.
    • We wish to install this script and make it runnable in the setting of the global library, so we should write a simple wrapper script to allow this, running the script from the context of its directory.
    • We should also investigate further (todos are needed) the representations that are actually used for the S-boxes by des2fml and try using our own.

Definition in file Cryptography.hpp.