Giter VIP home page Giter VIP logo

rjcrypt's Introduction

RJCrypt - Library

AES implementation of symmetric key encryption Rijndael using

Using

Declaring the main class

RJCrypt rj = new RJCrypt();

Encrypt a string using Rijndael AES 256-bit

string password = "eUCX6V54eTr?C8M";  // The password to encrypt the data with
string plaintext = "Text"; // The string to encrypt

// Encrypt the string
string ciphertext = rj.Encrypt(plaintext, password, RJCrypt.Common.KeySize.Aes256);

// Decrypt the string
plaintext = rj.Decrypt(ciphertext, password, RJCrypt.Common.KeySize.Aes256);

Encrypt a string using Authenticated Encryption (AE)

string password = "eUCX6V54eTr?C8M";  // The password to encrypt the data with
string plaintext = "Text"; // The string to encrypt

// Encrypt the string
string aeCiphertext = rj.Encrypt(plaintext, password, RJCrypt.Common.KeySize.Aes256);

// Decrypt the string
plaintext = rj.Decrypt(aeCiphertext, password, RJCrypt.Common.KeySize.Aes256);

Encrypt a file using Rijndael AES 256-bit

string password = "eUCX6V54eTr?C8M";            // The password to encrypt the file with
string plaintextFile = @"D:\Photo.png";         // The file to encrypt
string ciphertextFile = @"D:\ProtectedFiles";   // The encrypted file (extension unnecessary)

// Encrypt the file
rj.Encrypt(plaintextFile, ciphertextFile, password, RJCrypt.Common.KeySize.Aes256);

// Decrypt the file
rj.Decrypt(ciphertextFile, plaintextFile, password, RJCrypt.Common.KeySize.Aes256);

Settings

The Settings class is a set of default values that are changed in the library. Changing these settings by default is not required, but is available for developers who want more precise control of the Rijndael256 encryption system.

// The HashIterations setting is used in several places throughout the lib,
// with Rijndael.Encrypt being just one of them. After making this change,
// any future calls to Rijndael.Encrypt will make use of this new value
Settings.HashIterations = 25000;

// To reset all the settings to their default values
Settings.Reset();

Support or Contact

rjcrypt's People

Stargazers

 avatar

Watchers

 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.