项目作者: galets

项目描述 :
简单的.NET非对称加密实现
高级语言: C#
项目地址: git://github.com/galets/AsymmetricCrypt.git
创建时间: 2013-11-25T00:37:44Z
项目社区:https://github.com/galets/AsymmetricCrypt

开源协议:Apache License 2.0

下载


AsymmetricCrypt

Simple .NET asymmetric encryption implementation

Purpose:

data encryption on the systems, where storing password or key in cleartext is not desirable option.

Usage:

Tool will use standard io streams where possible, or files could be specified on command line

Generate private key:

  1. AsymmetricCrypt --genkey private.key
  2. AsymmetricCrypt --genkey >private.key

Extract public key component from private key:

  1. AsymmetricCrypt --publickey private.key public.key
  2. AsymmetricCrypt --publickey <private.key >public.key

Encrypt file using public key:

  1. AsymmetricCrypt --encrypt public.key plaintext.txt encrypted.ascr
  2. AsymmetricCrypt --encrypt public.key <plaintext.txt >encrypted.ascr

Decrypt file using private key:

  1. AsymmetricCrypt --decrypt private.key encrypted.ascr plaintext.txt
  2. AsymmetricCrypt --decrypt private.key <encrypted.ascr >plaintext.txt

Internals:

Each file is encrypted using AES256 with randomly generated key. AES256 key is encrypted using 4096
bit RSA and stored with the file.

File structure:

  1. 4 bytes: signature "ASCR"
  2. 16 bytes: AES IV
  3. 512 bytes: RSA 4096-encrypted AES key
  4. rest: encrypted file contents

Installing on Ubuntu:

Install using following commands:

  1. sudo apt-get install mono-runtime libmono-system2.0-cil wget
  2. sudo mkdir -p /usr/lib/ascry
  3. sudo wget https://raw.github.com/galets/AsymmetricCrypt/master/Binary/AsymmetricCrypt.exe \
  4. -O /usr/lib/ascry/AsymmetricCrypt.exe
  5. sudo chmod +x /usr/lib/ascry/AsymmetricCrypt.exe
  6. sudo ln -s /usr/lib/ascry/AsymmetricCrypt.exe /usr/bin/ascry