![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
cryptography
Advanced tools
Simplified functions for nodejs cryptography.
options
<Object>
| <string>
options.key
<string>
options.algorithm
<string>
options.encoding
<string>
options.data
<string>
options.callback
<Function>
Returns a promise which is resolved with encrypted string. If a callback is passed it is called with encrypted string.
options
<Object>
| <string>
options.key
<string>
options.algorithm
<string>
options.encoding
<string>
options.data
<string>
Synchronous encrypt(). Returns encrypted string.
options
<Object>
| <string>
options.key
<string>
options.algorithm
<string>
options.encoding
<string>
options.data
<string>
options.callback
<Function>
Returns a promise which is resolved with decrypted string. If a callback is passed it is called with decrypted string.
options
<Object>
| <string>
options.key
<string>
options.algorithm
<string>
options.encoding
<string>
options.data
<string>
Synchronous decrypt(). Returns decrypted string.
options
<Object>
| <string>
options.key
<string>
options.algorithm
<string>
options.encoding
<string>
options.data
<string>
options.callback
<Function>
Returns a promise which is resolved with hashed string. If a callback is passed it is called with hashed string.
options
<Object>
| <string>
options.key
<string>
options.algorithm
<string>
options.encoding
<string>
options.data
<string>
Synchronous hmac(). Returns hashed string.
options
<Object>
| <string>
options.key
<string>
options.algorithm
<string>
options.encoding
<string>
options.data
<string>
options.callback
<Function>
Returns a promise which is resolved with hashed string. If a callback is passed it is called with hashed string.
options
<Object>
| <string>
options.key
<string>
options.algorithm
<string>
options.encoding
<string>
options.data
<string>
Synchronous hash(). Returns hashed string.
options
<Object>
| <Number>
options.size
<Number>
options.encoding
<string>
options.callback
<Function>
Returns a promise which is resolved with random bytes string. If a callback is passed it is called with random bytes string.
Synchronous randomBytes(). Returns random bytes string.
const cryptography = require("cryptography");
// Set defaults
cryptography.defaults.key = "password";
cryptography.defaults.encryptionAlgorithm = "aes192";
cryptography.defaults.encoding = "hex";
// Use defaults
cryptography.encrypt("string to encrypt")
.then(function(encrypted)
{
return cryptography.decrypt(encrypted);
})
.then(function(decrypted)
{
console.log(decrypted) // outputs: "string to encrypt"
})
.catch(function(error)
{
// An error occurred
});
// Override defaults for one call
cryptography.encrypt({
key: "another password",
data: "string to encrypt"
})
.then(function(encrypted)
{
return cryptography.decrypt({
key: "another password",
data: encrypted
});
})
.then(function(decrypted)
{
console.log(decrypted) // outputs: "string to encrypt"
})
.catch(function(error)
{
// An error occurred
});
const cryptography = require("cryptography");
var decryptCallback = function(error, decrypted)
{
if(error)
{
// Error occurred
return;
}
console.log(decrypted);
};
var encryptCallback = function(error, encrypted)
{
if(error)
{
// Error occurred
return;
}
cryptography.decrypt({
data: encrypted,
callback: decryptCallback
});
};
cryptography.encrypt({
data: "string to encrypt",
callback: encryptCallback
});
const cryptography = require("cryptography");
try
{
var encrypted = cryptography.encryptSync("string to encrypt");
var decrypted = cryptography.decryptSync(encrypted);
}
catch(error)
{
// Error occurred
return;
}
console.log(decrypted);
FAQs
Simplified functions for nodejs cryptography.
The npm package cryptography receives a total of 138 weekly downloads. As such, cryptography popularity was classified as not popular.
We found that cryptography demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.