Coder Social home page Coder Social logo

sa6mwa / krypto431 Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 3.01 MB

Krypto431 is a Computer-Aided DIANA-based Cryptosystem (CADCRYS) interfacing human One Time Pad (OTP) ciphering with machines.

License: MIT License

Makefile 1.56% Go 98.44%
ciphers one-time-pad one-time-pad-cipher ciphertext

krypto431's People

Contributors

dependabot[bot] avatar sa6mwa avatar

Watchers

 avatar  avatar

krypto431's Issues

Make plural function

Make a plural function for writing words in plural based on number. Could be as simple as func plural(n, singular, plural) string {}.

Design new command structure

Command subcommand is perhaps neater than the current implementation. This is more of a spike, not sure if a new structure is more beneficial than the current design.

Main commands could be: new, list, delete, import, export.
Subcommand examples:

new key -n 100
new message
list keys
list messages
delete keys
import keys
export keys

Current setup is perhaps shorter with the added feature that you can combine importing, listing and outputting for example.

Create sqlite3 table structure

An encrypted sqlite3 db will be used to store persistent data such as keys, encrypted messages and state whether a key as been used or not, etc. There should also be some retention of used keys, e.g if key has been used, keep it in the db for X amount of days or something.

Delete key after Encipher of a message and wipe PlainText

The proper OTP-way is to delete and wipe a key after enciphering a message (DeleteKey will do both) instead of marking the key as Used and storing the key. Perhaps with a warning to dump the key (-o) and distribute it to the receiver(s)... or not, this should have already been done before sending messages to the receiver.

Create unit test to confirm non-biased random numbers (uniform distribution)

I don't know enough about RNG tests, but think it would be cool to have the RNG in Krypto431 pass all of the dieharder(1) tests. This is an example how to test the Linux /dev/urandom PRNG (well, /dev/random is also a PRNG, it just blocks when the entropy is out). We can do a similar test with the PRNGs in Krypto431, but the numbers need to be 0 to 25 (you probably need to set the range in dieharder somehow). For example, look at the two WEAK assessments below...

From the dieharder man page...

   Alternatively, dieharder can be used to test files of numbers  produced
   by a candidate random number generators:

     dieharder -a -g 201 -f random.org_bin

   for raw binary input or

     dieharder -a -g 202 -f random.org.txt
$ cat /dev/urandom | dieharder -a -g 200
#=============================================================================#
#            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
#=============================================================================#
   rng_name    |rands/second|   Seed   |
stdin_input_raw|  1.13e+07  |1428260778|
#=============================================================================#
        test_name   |ntup| tsamples |psamples|  p-value |Assessment
#=============================================================================#
   diehard_birthdays|   0|       100|     100|0.28151290|  PASSED  
      diehard_operm5|   0|   1000000|     100|0.62816230|  PASSED  
  diehard_rank_32x32|   0|     40000|     100|0.22641794|  PASSED  
    diehard_rank_6x8|   0|    100000|     100|0.07648248|  PASSED  
   diehard_bitstream|   0|   2097152|     100|0.90620443|  PASSED  
        diehard_opso|   0|   2097152|     100|0.19382105|  PASSED  
        diehard_oqso|   0|   2097152|     100|0.16862596|  PASSED  
         diehard_dna|   0|   2097152|     100|0.80774230|  PASSED  
diehard_count_1s_str|   0|    256000|     100|0.81936551|  PASSED  
diehard_count_1s_byt|   0|    256000|     100|0.17920809|  PASSED  
 diehard_parking_lot|   0|     12000|     100|0.96831462|  PASSED  
    diehard_2dsphere|   2|      8000|     100|0.96217378|  PASSED  
    diehard_3dsphere|   3|      4000|     100|0.55956984|  PASSED  
     diehard_squeeze|   0|    100000|     100|0.44334894|  PASSED  
        diehard_sums|   0|       100|     100|0.70990252|  PASSED  
        diehard_runs|   0|    100000|     100|0.75815013|  PASSED  
        diehard_runs|   0|    100000|     100|0.04289927|  PASSED  
       diehard_craps|   0|    200000|     100|0.94163220|  PASSED  
       diehard_craps|   0|    200000|     100|0.97273682|  PASSED  
 marsaglia_tsang_gcd|   0|  10000000|     100|0.91438421|  PASSED  
 marsaglia_tsang_gcd|   0|  10000000|     100|0.97598335|  PASSED  
         sts_monobit|   1|    100000|     100|0.60896355|  PASSED  
            sts_runs|   2|    100000|     100|0.74353520|  PASSED  
          sts_serial|   1|    100000|     100|0.19787900|  PASSED  
          sts_serial|   2|    100000|     100|0.70397015|  PASSED  
          sts_serial|   3|    100000|     100|0.08278372|  PASSED  
          sts_serial|   3|    100000|     100|0.93438930|  PASSED  
          sts_serial|   4|    100000|     100|0.07266823|  PASSED  
          sts_serial|   4|    100000|     100|0.20766267|  PASSED  
          sts_serial|   5|    100000|     100|0.23227633|  PASSED  
          sts_serial|   5|    100000|     100|0.99087787|  PASSED  
          sts_serial|   6|    100000|     100|0.02708506|  PASSED  
          sts_serial|   6|    100000|     100|0.23152481|  PASSED  
          sts_serial|   7|    100000|     100|0.00124029|   WEAK   
          sts_serial|   7|    100000|     100|0.00175634|   WEAK   
          sts_serial|   8|    100000|     100|0.15996183|  PASSED  
          sts_serial|   8|    100000|     100|0.63733538|  PASSED  
          sts_serial|   9|    100000|     100|0.58882223|  PASSED  
          sts_serial|   9|    100000|     100|0.09394493|  PASSED  
          sts_serial|  10|    100000|     100|0.35573017|  PASSED  
          sts_serial|  10|    100000|     100|0.59022963|  PASSED  
          sts_serial|  11|    100000|     100|0.52742847|  PASSED  
          sts_serial|  11|    100000|     100|0.89610194|  PASSED  
          sts_serial|  12|    100000|     100|0.14909867|  PASSED  
          sts_serial|  12|    100000|     100|0.92046940|  PASSED  
          sts_serial|  13|    100000|     100|0.88926749|  PASSED  
          sts_serial|  13|    100000|     100|0.30840791|  PASSED  
          sts_serial|  14|    100000|     100|0.46455530|  PASSED  
          sts_serial|  14|    100000|     100|0.70294453|  PASSED  
          sts_serial|  15|    100000|     100|0.20870357|  PASSED  
          sts_serial|  15|    100000|     100|0.01099756|  PASSED  
          sts_serial|  16|    100000|     100|0.22245261|  PASSED  
          sts_serial|  16|    100000|     100|0.55027247|  PASSED  
         rgb_bitdist|   1|    100000|     100|0.93378073|  PASSED  
         rgb_bitdist|   2|    100000|     100|0.81954461|  PASSED  
         rgb_bitdist|   3|    100000|     100|0.64799316|  PASSED  
         rgb_bitdist|   4|    100000|     100|0.35560131|  PASSED  
         rgb_bitdist|   5|    100000|     100|0.37430215|  PASSED  
         rgb_bitdist|   6|    100000|     100|0.42392682|  PASSED  
         rgb_bitdist|   7|    100000|     100|0.89174165|  PASSED  
         rgb_bitdist|   8|    100000|     100|0.65737678|  PASSED  
         rgb_bitdist|   9|    100000|     100|0.98717990|  PASSED  
         rgb_bitdist|  10|    100000|     100|0.33063485|  PASSED  
         rgb_bitdist|  11|    100000|     100|0.64609554|  PASSED  

...

Make modulo 26 table AKA Trigraph

This is just a table for the instructions. It should fit on a 1/4 of an A4 page and be printed with each key alongside the instructions on how to use Krypto431. Half of the A4 page is the key. Table can be done manually or generated in code, whatever is most convenient, it will always be the same - a standard modulo 26 table, just like the DIANA cipher (where this is called a trigraph).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.