From ec6de47f604f7ceba1d4155a7f13c1bf4d097b6b Mon Sep 17 00:00:00 2001 From: Stanislav Muhametsin <346799+stazz@users.noreply.github.com> Date: Sun, 16 Jan 2022 17:26:50 +0200 Subject: [PATCH] Updated README as per #37 --- Source/UtilPack.Cryptography.SASL.SCRAM/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/UtilPack.Cryptography.SASL.SCRAM/README.md b/Source/UtilPack.Cryptography.SASL.SCRAM/README.md index 1a8d742..09fb8b8 100644 --- a/Source/UtilPack.Cryptography.SASL.SCRAM/README.md +++ b/Source/UtilPack.Cryptography.SASL.SCRAM/README.md @@ -1,13 +1,13 @@ # UtilPack.Cryptography.SASL.SCRAM -This is library implementing SCRAM-(SHA128|256|512) protocol without dynamically allocating any strings. -The SCRAM protocol handlers are accessible via extension methods for `BlockDigestAlgorithm` interface of [UtilPack.Cryptography.Digest](../UtilPack.Cryptography.Digest) project. +This is library implementing SCRAM-(SHA-1|SHA-256|SHA-512) protocol without dynamically allocating any strings. +The SCRAM protocol handlers are accessible via extension methods for BlockDigestAlgorithm interface of UtilPack.Cryptography.Digest project. Here is an example for authenticating as a client: ```csharp using UtilPack.Cryptography.Digest; -// Example of using SCRAM-SHA256 +// Example of using SCRAM-SHA-256 // Variables username, password, and stream are assumed to be coming from elsewhere in this example. using ( var client = new SHA256().CreateSASLClientSCRAM() ) { @@ -33,7 +33,7 @@ using ( var client = new SHA256().CreateSASLClientSCRAM() ) // Read server-first message var readBytes = new Byte[10000]; // Assume static max size for this small example - var readCount = await stream.ReadAsync( readBytes, 0, readBytes.Length ); // Assume this simple and naïve read for this small example + var readCount = await stream.ReadAsync( readBytes, 0, readBytes.Length ); // Assume this simple and naïve read for this small example // Create client-final message (bytesWritten, challengeResult) = await client.ChallengeOrThrowOnErrorAsync( credentials.CreateChallengeArguments( @@ -45,7 +45,7 @@ using ( var client = new SHA256().CreateSASLClientSCRAM() ) encoding ) ); - // At this point, credentials.PasswordDigest will contain result of PBKDF2 iteration, if cleartext password as specified earlier + // At this point, credentials.PasswordDigest will contain result of PBKDF2 iteration, if cleartext password was specified earlier // Write client-final message await stream.WriteAsync( writeArray.Array, 0, bytesWritten ); @@ -74,4 +74,4 @@ See [NuGet package](http://www.nuget.org/packages/UtilPack.Cryptography.SASL.SCR # TODO Modify code as needed after starting to use Span (currently, the code for client and server SCRAM not the prettiest code there is). -This will require a polyfill (in UtilPack, most likely) for .NET 4.0. \ No newline at end of file +This will require a polyfill (in UtilPack, most likely) for .NET 4.0.