NASA-AMMOS / AIT-DSN

MIT License
19 stars 10 forks source link

Issue 140: Engineering release of AIT encryption support #142

Closed nttoole closed 2 years ago

nttoole commented 2 years ago

AIT now offers an encryption API with some supported implementations, and to which extensions can be added. The default implementation, NullEncrypter, supports the API but performs no encryption/decryption.

For projects which utilize the MGSS KMC SDLS Encryption service, AIT offers a wrapper for that service, KmcSdlsEncrypter.

Encryption is currently limited to support command uplink (TC Frames), though may be expanded for downlink at some future date.

This PR supports a schedule engineering release of the AIT Encryption API for use by SunRise.

General documentation is available here: https://github.com/NASA-AMMOS/AIT-DSN/blob/issue-140/doc/source/encryption.rst


Included is a new command-line tool ait_encrypt, which allows the binary contents of a file to be encrypted and decrypted using available encrypter classes:

usage: ait_encrypt.py [-h] --mode {encrypt,decrypt} --type TYPE --input INPUT 
                      [--output OUTPUT] [--verbose]

Performs encryption or decryption on bytes from a file.

optional arguments:
  -h, --help            show this help message and exit
  --mode {encrypt,decrypt}
                        Mode: 'encrypt', 'decrypt' (default: encrypt)
  --type TYPE           Type of encrypter to use: 'null', 'kmc'; or full class name
                        (default: null)
  --input INPUT         Input filename, required. (default: None)
  --output OUTPUT       Output filename, optional. (default: None)
  --verbose             Print debug messages. (default: False)

Examples:

  $ ait_encrypt --mode encrypt --type null --input input.bin  --output output.bin
  $ ait_encrypt --mode decrypt --type null --input output.bin --output restored.bin

Fixes #140

nttoole commented 2 years ago

Status: Testing with KMC Client results in underlying SQL syntax errors, but due to delivery schedule, we are merging this today.