Giter Site home page Giter Site logo

saylouis's Introduction

saylouis

Compilation

Use Argon2i key derivation to generate my public key from a passphrase. The public key is then hard-coded into the saylouis source before compilation.

Encryption

Generate a new X25519 key pair. Perform X25519 key exchange with my stored public key and hash the result to produce a shared secret. Use this shared secret and the public key for authenticated encryption via XChaCha20. Output a hidden form of the public key (indistinguishable from random noise), a MAC, and the ciphertext. Also output a fingerprint of the public key.

Details:

  1. My public key lp is hard-coded into the binary.
  2. Generate a 32-byte random seed seed.
  3. Use crypto_hidden_key_pair(uhp, uk, seed) to get a (hidden) public key uhp and a private key uk.
  4. Use crypto_x25519(rs, uk, lp) to get secret rs, and then hash it using ss = BLAKE2b(rs || uhp || lp) to get the final shared secret.
  5. Output uhp.
  6. Input at most blocksize bytes.
  7. Call crypto_lock on ss, plaintext, using a count (starting at zero) of the blocks as the nonce, to get the ciphertext and mac.
  8. Output mac || ciphertext. If there's more input to handle, go to 6.
  9. Display a fingerprint of uhp.

Decryption

Read the public key from the input, display the fingerprint and confirm it's okay to continue. Use Argon2i key derivation to compute my public and private key from a passphrase. Authenticate the ciphertext using the mac, decrypt using the nonce and my secret key.

saylouis's People

Contributors

louisswarren avatar

Watchers

James Cloos avatar  avatar

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.