Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@toruslabs/openlogin-utils
Advanced tools
OpenLogin is a plug & play authentication suite that combines the simplicity of passwordless authentication with the security of non-custodial public key infrastructure (PKI).
@toruslabs/openlogin-utils is a utility package designed to assist with various functionalities related to OpenLogin, a passwordless authentication solution. It provides tools for encoding, decoding, and other cryptographic operations that are essential for secure authentication processes.
Base64 Encoding and Decoding
This feature allows you to encode and decode strings using base64url encoding, which is a URL-safe variant of base64 encoding.
const { base64url } = require('@toruslabs/openlogin-utils');
// Encoding a string to base64url
const encoded = base64url.encode('Hello, World!');
console.log(encoded); // Outputs: 'SGVsbG8sIFdvcmxkIQ'
// Decoding a base64url string
const decoded = base64url.decode(encoded);
console.log(decoded); // Outputs: 'Hello, World!'
Hex Encoding and Decoding
This feature allows you to convert strings to their hexadecimal representation and vice versa.
const { toHex, fromHex } = require('@toruslabs/openlogin-utils');
// Converting a string to hex
const hexString = toHex('Hello, World!');
console.log(hexString); // Outputs: '48656c6c6f2c20576f726c6421'
// Converting a hex string back to a regular string
const normalString = fromHex(hexString);
console.log(normalString); // Outputs: 'Hello, World!'
SHA-256 Hashing
This feature provides a way to hash strings using the SHA-256 algorithm, which is commonly used in cryptographic applications.
const { keccak256 } = require('@toruslabs/openlogin-utils');
// Hashing a string using SHA-256
const hash = keccak256('Hello, World!');
console.log(hash); // Outputs: '0x...'
crypto-js is a widely-used library that provides a variety of cryptographic algorithms including MD5, SHA-1, SHA-256, and more. It offers similar functionalities to @toruslabs/openlogin-utils but with a broader range of cryptographic tools.
jsonwebtoken is a package used to sign, verify, and decode JSON Web Tokens (JWT). While it focuses more on JWT operations, it also provides encoding and decoding functionalities similar to those in @toruslabs/openlogin-utils.
base64url is a dedicated package for base64url encoding and decoding. It offers a more focused approach to base64url operations compared to the broader utility functions provided by @toruslabs/openlogin-utils.
OpenLogin is a plug & play authentication suite that combines the simplicity of passwordless authentication with the security of non-custodial public key infrastructure (PKI).
OpenLogin utils contains supporting utility functions for OpenLogin.
Head over to docs to get started.
FAQs
OpenLogin is a plug & play authentication suite that combines the simplicity of passwordless authentication with the security of non-custodial public key infrastructure (PKI).
The npm package @toruslabs/openlogin-utils receives a total of 94,943 weekly downloads. As such, @toruslabs/openlogin-utils popularity was classified as popular.
We found that @toruslabs/openlogin-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.