Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
class SCRAM
import { SCRAM } from "https://deno.land/x/kafkasaur@v0.0.7/src/broker/saslAuthenticator/scram.ts";

Constructors

new
SCRAM(
connection: any,
logger: any,
saslAuthenticate: any,
digestDefinition: DigestDefinition,
)

Properties

connection: any
currentNonce: any
digestDefinition: DigestDefinition
logger: any
PREFIX: any
saslAuthenticate: any

Methods

authMessage(clientMessageResponse: any)
clientKey(clientMessageResponse: any)
clientProof(clientMessageResponse: any)
clientSignature(storedKey: any, clientMessageResponse: any)
finalMessageWithoutProof(clientMessageResponse: any)
H(data: string | ArrayBuffer)
HMAC(key: Message, data: Message)
saltPassword(clientMessageResponse: any)
sendClientFinalMessage(clientMessageResponse: any)
serverKey(clientMessageResponse: any)
serverSignature(serverKey: any, clientMessageResponse: any)

Static Methods

hi(
password: HASH_DATA,
salt: HASH_DATA,
iterations: number,
digestDefinition: DigestDefinition,
)

Hi() is, essentially, PBKDF2 [RFC2898] with HMAC() as the pseudorandom function (PRF) and with dkLen == output length of HMAC() == output length of H()

In cryptography, a nonce is an arbitrary number that can be used just once. It is similar in spirit to a nonce * word, hence the name. It is often a random or pseudo-random number issued in an authentication protocol to * ensure that old communications cannot be reused in replay attacks.

sanitizeString(str: any)

From https://tools.ietf.org/html/rfc5802#section-5.1

The characters ',' or '=' in usernames are sent as '=2C' and '=3D' respectively. If the server receives a username that contains '=' not followed by either '2C' or '3D', then the server MUST fail the authentication.

xor(left: any, right: any)

Apply the exclusive-or operation to combine the octet string on the left of this operator with the octet string on the right of this operator. The length of the output and each of the two inputs will be the same for this use