Socket
Book a DemoInstallSign in
Socket

@0to10/secure-profiles

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@0to10/secure-profiles

Typescript library for working with encrypted profiles

1.0.0
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Secure Profile

This repository provides structures to work with encrypted profiles.

Getting started

Get started quickly by following the instructions below.

Installation

Use NPM to install this library into your project:

npm install --save @0to10/secure-profiles

Configuration

All configuration must be done before using any other structures provided by this package, or risk ending with an unstable state and/or corrupted data.

Configure the available cryptography parameters. Example below:

import {CryptoVersions} from '@0to10/secure-profiles';

CryptoVersions.configure([
    {
        number: 1,
        algorithm: {
            name: 'AES-CTR',
            iv_length: 64,
        },
    },
]);

Create a profile

Below is an example of how to create a new profile, using the ProfileFactory class and adding some data to it.

The Profile instance created by the ProfileFactory is a roaming profile, meaning that it is unencrypted and mutable. A roaming profile may only be used locally on an authorised device, and must never leave that device in its unencrypted form.

'use strict';

import {ProfileFactory, RoamingProfile} from '@0to10/secure-profiles';

const factory: ProfileFactory = new ProfileFactory();

const profile: RoamingProfile = factory.create();
profile.data.set('sensitive_information', 'I am using a Qwerty keyboard.');

Any required authentication information should be stored outside the profile, as this information is not accessible until the profile is decrypted.

Encrypt a profile

Before transporting the profile, it must be encrypted. Classes that transport or store a profile instance must refuse storing any unsealed profiles.

'use strict';

import {EncryptedProfile, Profile, ProfileFactory} from '@0to10/secure-profiles';

const factory: ProfileFactory = new ProfileFactory();

const profile = factory.create();
// Modify the profile

const encryptedProfile: EncryptedProfile = profile.encrypt(
    profile.deriveMasterKey('MyS3cretPassw0rd!')
);

// Store the profile

Keywords

cryptography

FAQs

Package last updated on 21 Jan 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.