This package has been discontinued because it never evolved, and the current code does not justify its continuation. .NET has evolved significantly, and most of the features provided by this library are now built into the framework with better security and performance.
Helpers, extensions and utilities to work with security
- Support to
- How to use
- Contribution
- .NET 3.1 or more
- .NET Framework 4.6.2 or more
- .NET Standard 2.0 or more
This package is available through Nuget Packages: https://www.nuget.org/packages/PowerUtils.Security
Nuget
Install-Package PowerUtils.Security.NET CLI
dotnet add package PowerUtils.Security
Convert a text to hash MD5
// result = "dc483e80a7a0bd9ef71d8cf973673924"
var result = "a123456".ToMD5();Convert a text to hash SHA1
// result = "895b317c76b8e504c2fb32dbb4420178f60ce321"
var result = "a123456".ToSHA1();Convert a text to hash SHA256
// result = "20f645c703944a0027acf6fad92ec465247842450605c5406b50676ff0dcd5ea"
var result = "a123456".ToSHA256();Convert a text to hash SHA384
// result = "fec1bb0e04ed484a4e5e37e585c9d15f863db7e7f5585e047a1be80e269d50abb177e61c264f6c0443e4d8e26b235d8e"
var result = "a123456".ToSHA384();Convert a text to hash SHA512
// result = "410752b9f6fef035ccb2b469bcc473d7d43e93a108332bc1eb3208412d599bb4478eea687c69f962d7670410b06deaeac77578452f7c2454f3100d017a802b7e"
var result = "a123456".ToSHA512();Encode text to base64
// result = "SGVsbG9Xb3JsZA=="
var result = "HelloWorld".ToBase64();Decode base64 to original text
// result = "HelloWorld"
var result = "SGVsbG9Xb3JsZA==".FromBase64();Encrypt text based in passPhrase
var passPhrase = "fssdf4523543dfd";
// result = "zhwH2dmpqUebzikGD4UHnw=="
var result = "HelloWorld".Encrypt();Decrypt cipher text
var passPhrase = "fssdf4523543dfd";
// result = "HelloWorld"
var result = "zhwH2dmpqUebzikGD4UHnw==".Decrypt();Anonymize sensitive information
// result = "N****e"
var result = "Nelson Nobre".Anonymize();Encode username and password to basic authentication (btoa) [Beautiful to Awful]
var username = "jon";
var password = "a123456";
// result = "am9uOmExMjM0NTY="
var result = UtilsAuth.ToBasicAuth(username, password);Decode from basic authentication (atob) [Awful to Beautiful]
// username = "jon" | password = "a123456"
var result = "am9uOmExMjM0NTY=".FromBasicAuth();If you have any questions, comments, or suggestions, please open an issue or create a pull request
