<script src="blackfeather-2.0.0.min.js"></script>
You can also convert the main node js module into your own module with browserify at any time.
npm install -g browserify
browserify blackfeather-2.0.0.js -o blackfeather.2.0.0.min.js
npm install Blackfeather --save
Install-Package blackfeatherjs
git clone https://github.com/TimothyMeadows/blackfeatherjs
Ths is a helper class for storing data in memory in JavaScript. It supports serialization between languages allowing you to import, and, export serializable types.
Model that data in memory is read, and, written too.
Blackfeather.Data.ManagedMemorySpace = function (pointer, name, value, created, accessed, updated) {
this.Created = created; // unix time
this.Accessed = accessed; // unix time
this.Updated = updated; // unix time
this.Pointer = pointer; // string
this.Name = name; // string
this.Value = value; // any
};
Read entry from memory that matches the pointer, and, name.
var memory = new Blackfeather.Data.ManagedMemory();
var caw = memory.Read("birds", "raven");
console.log(caw);
Read all entries from memory that matches the pointer.
var memory = new Blackfeather.Data.ManagedMemory();
var birds = memory.ReadAll("birds");
console.log(birds);
Write entry into memory. Remove any previous entry that matches the pointer, and, name.
var memory = new Blackfeather.Data.ManagedMemory();
memory.Write("birds", "raven", "caw");
Write all entres into memory. Remove any previous entries that matches the pointer, and, name.
var memory = new Blackfeather.Data.ManagedMemory();
var spaces = [new Blackfeather.Data.ManagedMemorySpace("birds", "raven", "caw", 0, 0, 0)];
memory.WriteAll(spaces);
Remove any entry from memory that matches the pointer, and, name.
var memory = new Blackfeather.Data.ManagedMemory();
memory.Delete("birds", "raven");
Remove all entries from memory that matches the pointer.
var memory = new Blackfeather.Data.ManagedMemory();
memory.DeleteAll("birds");
Load ManagedMemory class as current MangedMemory class.
var memory = new Blackfeather.Data.ManagedMemory();
var memory2 = new Blackfeather.Data.ManagedMemory();
memory.Import(memory2);
Return current ManagedMemory class.
var memory = new Blackfeather.Data.ManagedMemory();
var memory2 = memory.Export();
Remove all entries from memory. Leaves memory still usable.
var memory = new Blackfeather.Data.ManagedMemory();
memory.Clear();
Remove all entries from memory. Leaves memory unusable until reconstructed.
var memory = new Blackfeather.Data.ManagedMemory();
memory.Dispose();
This is a collection of usable compression libraries in JavaScript. Right now only LZStrng is supported.
var compressed = Blackfeather.Data.Compression.LZString.Compress("caw caw caw!");
console.log(compressed);
var decompressed = Blackfeather.Data.Compression.LZString.Decompress(
Blackfeather.Data.Compression.LZString.Compress("caw caw caw!")
);
console.log(compressed);
Latin1
Utf8
Utf16
Utf16BigEndian
Utf16LittleEndian
Hex
Base64
Blackfeather.Security.Cryptology.SaltedData = function () {
this.Data = null;
this.Salt = null;
}
Returns random bytes to the specified length.
var rng = new Blackfeather.Security.Cryptology.SecureRandom().NextBytes(16);
console.log(rng);
Returns random bytes to the specified length.
var rng = new Blackfeather.Security.Cryptology.SecureRandom().NextBigInt(2048);
console.log(rng);
Returns random bytes to the specified length.
var rng = new Blackfeather.Security.Cryptology.SecureRandom().Next(32, 134);
console.log(rng);
Compute PBKDF2 returning SaltedData.
var kdf = new Blackfeather.Security.Cryptology.Kdf().Compute(
"caw caw caw!",
"tNfyIx2PZjf6C+KC9N7Ydg==",
32
);
console.log(kdf);
Compute SHA256 wth PBKDF2 returning SaltedData.
var hash = new Blackfeather.Security.Cryptology.Hash().Compute(
"caw caw caw!",
"tNfyIx2PZjf6C+KC9N7Ydg=="
);
console.log(hash);
Compute HMAC-SHA256 wth PBKDF2 returning SaltedData.
var hmac = new Blackfeather.Security.Cryptology.Hmac().Compute(
"caw caw caw!",
"water123",
"tNfyIx2PZjf6C+KC9N7Ydg=="
);
console.log(hmac);
Compute authentcated AES-CTR wth HMAC-SHA256, and, PBKDF2.
var cipher = new Blackfeather.Security.Cryptology.EncryptionInMotion().Compute(
"caw caw caw!",
"water123",
"tNfyIx2PZjf6C+KC9N7Ydg==",
"321retaw"
);
console.log(cipher);
Compute authentcated AES-CTR wth HMAC-SHA256, and, PBKDF2.
var plain = new Blackfeather.Security.Cryptology.DecryptionInMotion().Compute(
"cJHuTYcAV5j798aJuSwPtLcemE86qhXOPDfRWQffIzwVUqctciDLIZNFspmBB3ym7hwVvydcsJeqtE/HmiLwiJCbu6Pwq/V5NZopupTq00BO34PMeQ+DcOkZvKrA/mLlxB0uZO3clclmMXj9+hfLtKKdNnGJTYHWg4dJEg==",
"water123",
"tNfyIx2PZjf6C+KC9N7Ydg==",
"321retaw"
);
console.log(plain);
Compute authentcated AES-CTR wth HMAC-SHA256, and, PBKDF2.
var cipher = new Blackfeather.Security.Cryptology.EncryptionAtRest().Compute(
"caw caw caw!",
"water123",
"tNfyIx2PZjf6C+KC9N7Ydg==",
"321retaw"
);
console.log(cipher);
Compute authentcated AES-CTR wth HMAC-SHA256, and, PBKDF2.
var plain = new Blackfeather.Security.Cryptology.DecryptionAtRest().Compute(
"1SYn3HBRIDCYaMPSoJAsMc8iwOwjb7JRjq+wyhjEB+Xvo0rbVWTgqgPk/cBKZqv0Bk+ioUzly29hdZmCtfQzi/CfiUK6fAl7pnE5HyGO1AcUHi9wxXxlkiC/FQGKpt81LNQVHu+vmW4oFIProNrbqv9UzGW9eLfOC6UqCANEIDs=",
"water123",
"tNfyIx2PZjf6C+KC9N7Ydg==",
"321retaw"
);
console.log(plain);
ar client = new Blackfeather.Security.Cryptology.KeyExchange().Mix();
var serverPublic = "10072451067358128667370122172133565286426273520457081541202696009092543305211841094697906349575345674115923241301922156530480175764026481816770507437923200637573363088905607034558695241173246307009995878117784478243313131685968854799300800700691656662848606744118040971840314947233291339212661690749394423715891911134762717021019928988569780826551116299625361903924016859140944701252642684457210980390047869449067290007099386872773076553494951935303123004213090275240758545751867197472450416424811618764768165224643793362948959692975844359439266365789906954808980720889327586602558296556297716800168958101769299242493";
var KeyPair = new Blackfeather.Security.Cryptology.KeyExchange().KeyPair;
var clientHandshake = new KeyPair(client.Private, serverPublic);
var clientSecret = new Blackfeather.Security.Cryptology.KeyExchange().Remix(clientHandshake);
console.log(client);
console.log(clientSecret);