Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-e2e-encryption
Advanced tools
Readme
npm
Package)Forked to work without tweetnacl-utils to work with react-native.
The primary aim of this package is to provide easier End-2-End encryption for the client-side
web applications. This package is a wrapper around the original tweetnacl
NPM package and uses its functions and object definitions internally.
You can install e2e-encryption
via a package manager:
NPM:
$ npm install react-native-e2e-encryption
yarn:
$ yarn add react-native-e2e-encryption
Internally uses the x25519-xsalsa20-poly1305 algorithm, that has been implemented by tweetnacl
package.
Generates a new random key pair for object if publicKey
or privateKey
arguments are empty and returns it as an object:
const instance = new E2E('', '', {});
Attributes and function calls supported by the object:
{
publicKey: ...,
privateKey: ...,
Encrypt: (plainText, receiverPublicKey, options),
Decrypt: (cipherText, senderPublicKey, options),
}
Options
attributes allows you to set the flag to use same symmetric keys for the same client everytime.
{
useSameKeyPerClient: true / false
}
Generates the encrypted text using a symmetric key generated / used automatically in the internal execution which depends on the local options
object passed above or the global options
object, that was used during the instance creation.
NOTE: The
payload
should always be aJSON
object.
const encryptedText = sender.Encrypt({ Hello: 'World' }, receiverPublicKey, {
useSameKeyPerClient: true,
});
encryptedText
contains the payload that was encrypted and is appended by the Symmetric Key, used to encrypt the payload, encrypted by the sender's private key
and receiver's public key
.
<Encrypted Payload>.<Encrypted Symmetric Key>
Local Options
object passed here takes precedence over the global Options
.
Generates the decrypted text by extracting / using the symmetric key automatically which depends on the local Options
object passed or the global Options
object that was used during the instance creation.
const DecryptedText = receiver.Decrypt(
'<encrypted payload>.<encrypted symmetric key>',
senderPublicKey,
{
useSameKeyPerClient: true,
},
);
DecryptedText
is the JSON
object that was encrypted.
{ Hello: 'World' }
Local Options
object passed takes precedence over the global Options
passed.
The function will throw an error if:
Install NPM modules needed for development:
$ npm install
To build minified versions:
$ npm build
To run tests:
$ npm test
FAQs
Send and receive messages in an End-to-End Encrypted Environment.
The npm package react-native-e2e-encryption receives a total of 0 weekly downloads. As such, react-native-e2e-encryption popularity was classified as not popular.
We found that react-native-e2e-encryption 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.