Git Product home page Git Product logo

cosmos-security's Introduction

Cosmos Security Overview NuGet Version

Cosmos.Security is an inline project of Cosmosloops labs..

Install

From NuGet:

Install-Package Cosmos.Security.Encryption

Includes

  • MD2
  • MD4
  • MD5
  • SHA1/256/384/512
  • SM3
  • HMAC
  • MurmurHash2
  • MurmurHash3
  • Time33/DBJ33A
  • AES
  • DES/TripleDES
  • RC4
  • RCX/ThreeRCX
  • RCY/ThreeRCY
  • SM4
  • TEA/XTEA/XXTEA
  • DSA
  • RSA
  • SM2 (partially implement)

Usage

HAMC-SHA1:

var signature = HMACSHA1HashingProvider.Signature("image", "alexinea");

DES without salt:

var s = DESEncryptionProvider.Encrypt("image", "alexinea", "forerunner");
Assert.Equal("fJ2yrnAPaH0=", s);

var o = DESEncryptionProvider.Decrypt(s, "alexinea", "forerunner");
Assert.Equal("image", o);

DES with salt:

var s = DESEncryptionProvider.Encrypt("image", "alexinea", "forerunner", "123412341234");
Assert.Equal("s4h5u8hA/2Y=", s);

var o = DESEncryptionProvider.Decrypt(s, "alexinea", "forerunner", "123412341234");
Assert.Equal("image", o);

DES with salt and autokey

var key = DESEncryptionProvider.CreateKey();
var s = DESEncryptionProvider.Encrypt("image", key.Key, key.IV, "123412341234");
var o = DESEncryptionProvider.Decrypt(s, key.Key, key.IV, "123412341234");
Assert.Equal("image", o);

Thanks

People or projects that have made a great contribbution to this project:

Organizations and projects

License

Member project of Cosmosloops labs..

Apache License 2.0

cosmos-security's People

Contributors

alexinea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cosmos-security's Issues

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.