davinci

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 4 Imported by: 0

README

Unit tests Davinci CLI Test CodeQL

DaVinci

Fastest and secure way to encrypt and decrypt large files.

Installation

You can download binary files for each platform from the latest releases.

Usage

  • Generate passphrase (stored in a file)
davinci new-passphrase --folder ./path-to-folder

Returns a passphrase in the file passphrase.txt

  • Generate public and private key (stored in a file)
davinci new-keypair --size 2048 --passphrase ./passphrase.key --folder ./path-to-folder

Returns the public key in the file publicKey.pem and the private key in the file privateKey.pem.

  • Generate Symmetric key (stored in a file)
davinci key --folder ./path-to-folder

Return the symmetric key in the file key.txt.

  • Encrypt a file
davinci encrypt --input ./file.ext --output ./file-decrypted.ext --key ./key.txt --passphrase ./passphrase.key --public-key ./publicKey.pem

Encrypts the file file.ext using the key key.txt (encrypted using RSA) and stores the result in file-decrypted.ext.

  • Decrypt a file
davinci decrypt --input ./file-decrypted.ext --output ./file.ext --passphrase ./passphrase.key --private-key ./privateKey.pem

Decrypts the file file-decrypted.ext using the key key.txt (encrypted using RSA) and stores the result in file.ext.

Building (obfuscated version)

go install
bash build.sh

# or

chmod +x build.sh
./build.sh

Algorithm Specification

Key Generation:

  • Generate the public and private key pair, afterwards we call this pubK and privK.
  • Generate the symmetric key, afterwards we call this R.

Encryption:

  • Encrypt symmetric key using the public key. Enc(R, pubK), afterwards we call this R_enc.
  • Encrypt file using the symmetric key. Enc(file, R), afterwards we call this file_enc. The generated file will be in this format: R_enc + \n + file_enc

Decryption:

  • Decrypt symmetric key using the private key. Dec(R_enc, privK)=R
  • Decrypt file using the decrypted symmetric key. Dec(file_enc, R)

Requirements

Dependencies

  • CLI Framework
    • github.com/cpuguy83/go-md2man/v2
    • github.com/russross/blackfriday/v2
    • github.com/urfave/cli/v2
    • github.com/xrash/smetrics
  • Source code
    • strconv
    • encoding/base64
    • crypto/aes
    • crypto/cipher
    • crypto/rand
    • crypto/rsa
    • crypto/sha256
    • crypto/x509
    • encoding/pem
    • fmt
    • io/ioutil
    • os
    • path/filepath

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL