Cryptographically Secure Modem Messaging Framework

Discussion in 'ComputerCraft Programming' started by gknova61, Jan 29, 2014.

  1. gknova61

    gknova61 Farbes Lover

    Joined:
    Mar 17, 2012
    Messages:
    1,238
    Likes Received:
    350
    Background:
    As some of you may know, I've tried to make an actually secure (encrypted) login system for our base last reset because the public ones could be easily cracked by a monkey with a keyboard but like every programmer, I ran into a few walls. The wall I (and a few other people) was banging my head against was the fact that the Rednet API was reformed so basically every unencrypted message you send is in the clear for anyone to read, and that the Rednet API was no longer secure if you relied on computer ID's or confidentiality.

    With the help of a few people (legoman132, MyddrinE and hsun324), I was able to learn from my mistakes and instead of trying to fix the broken login system, I thought if I could do what no one else did publicly, and make the framework to a secure method for multiple computers to communicate wirelessly, then everything else like login systems, banking, etc. could be built on top of it.

    So, here I present to you, the Crytographically Secure Modem Messaging Framework or C.S.M.M.F. for short! This functions similar to the Rednet API in that it can be thought of as a wrapper for the Modem API.

    Features:
    *My version of certificates! These files must be pre-shared amongst your clients. Contains public keys, and signature verification keys (aka nothing private).
    *Sync program to make pre-sharing certificates quick'n'easy!
    *JSON-encoded
    *Integrity check (digital signatures, and hash comparisons)
    *Replay-attack prevention (messages are sent with a timestamp, and hashes of every message are stored then compared for redundancy)
    *Great Performance! The only thing that would take up time a significant amount of time (up to 0.3sec) is generating RSA encryption keys which should only be done once on every computer, anyways.

    Practical Applications:
    *Secure login systems for your base
    *Mail, and IRC-like systems
    *CC Bank
    *The overly paranoid nut

    Limitations:
    -RSA-encrypted messages cannot exceed 117 characters due to the limited key generation size
    -AES-encrypted messages cannot exceed 77 characters due to the limited key generation size

    Download: Postponed. This encryption API relies heavily on the Cryptographic Accelerator which was apparently removed and not documented so I need to find lua implementations of the same thing and implement them which has potential to lag the server now :)

    Documentation:
    Coming soon!
    Todo List:
    *Minor Code Cleanup
    *Key exchange system using RSA for clients to agree on a symmetric key (contact me if you can help with this!)

    tl;dr You can secure rednet messages!
     
  2. IdioticAussie

    IdioticAussie Member

    Joined:
    Dec 11, 2013
    Messages:
    100
    Likes Received:
    13
  3. LeiserGeist

    LeiserGeist Gamer, Software Developer

    Joined:
    Oct 26, 2012
    Messages:
    479
    Likes Received:
    116
    Sounds awesome, I was about to embark on this journey myself a few days ago but said fuggit
     
  4. gknova61

    gknova61 Farbes Lover

    Joined:
    Mar 17, 2012
    Messages:
    1,238
    Likes Received:
    350
    Thread updated, sorry for the wait, guys. Check the download section for more information.
     
  5. Azimath

    Azimath Master Zepplin Thief

    Joined:
    Jan 22, 2012
    Messages:
    30
    Likes Received:
    6
    I'd love to have a look at the source for this one day (I really have been away from alice for a long time). I've found a LUA implementation of SHA-1, for my mag card door, but never RSA or AES (admittedly I haven't searched much). Should totally get something like this rolled into the ROM rednet api on the server (if it wasn't for the lag). I might have to hop on and try to find everyone's rednet channels for the LMSA 2.0.