Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

dguard

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dguard - npm Package Compare versions

Comparing version
1.0.3
to
1.0.5
+49
README.md
# DGuard
## Installation
### 1. Install OpenSSL
* CentOS, Fedora, RHEL
```bash
sudo yum install openssl-devel
```
* Ubuntu
```bash
sudo apt-get install libssl-dev
```
* macOS
```bash
xcode-select --install
```
If you have a problem although your mac already installed xcode-select, you can try this command (not responsible for any damage):
```bash
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
```
### 2. Install the package
```bash
npm i @point3/dguard
```
## Usage
```typescript
dguard.init({ local: false });
async function myFunction() {
const encrypted = await dguard.encrypt("CRYPTO", "ENC", "테스트");
console.log("ENC:", encrypted); // "ENC: KrYf33BmD8uoqlWEQ8AG9A=="
const decrypted = await dguard.decrypt("CRYPTO", "ENC", encrypted);
console.log("DEC:", decrypted); // "DEC: 테스트"
const hashed = await dguard.hash("CRYPTO", "PWD", "1111111111");
console.log("PWD:", hashed); // "PWD: R4RJJu0F8cTeWYH3o5GqNriPQdjcX0UpmoZGrqBJq2s="
}
dguard.close();
```
+1
-1

@@ -7,3 +7,3 @@ cmake_minimum_required(VERSION 3.15)

project (dguard)
project (dguard LANGUAGES CXX)

@@ -10,0 +10,0 @@ add_definitions(-DNAPI_VERSION=3)

@@ -10,7 +10,40 @@ declare module 'dguard' {

/**
* DGuard를 초기화합니다.
* @param options
*/
export function init(options?: { local: boolean }): void;
/**
* value를 암호화합니다.
* @param tableName
* @param columnName
* @param value
* @throws {Error} KMS 오류로 암호화에 실패했을 때
*/
export function encrypt(tableName: string, columnName: string, value: string): Promise<string>;
/**
* value를 복호화합니다.
* @param tableName
* @param columnName
* @param value
* @throws {Error} value 값이 잘못됨
* @throws {Error} KMS 오류로 복호화에 실패
*/
export function decrypt(tableName: string, columnName: string, value: string): Promise<string>;
export function hash(tableName: string, columnName: string): Promise<void>;
/**
* value로 hash를 생성합니다.
* @param tableName
* @param columnName
* @param value
* @throws {Error} KMS 오류로 hash 생성에 실패
*/
export function hash(tableName: string, columnName: string, value: string): Promise<string>;
/**
* DGuard를 종료합니다.
*/
export function close(): void;
}
{
"name": "dguard",
"version": "1.0.3",
"version": "1.0.5",
"main": "index.js",

@@ -5,0 +5,0 @@ "types": "module.d.ts",

@@ -5,2 +5,4 @@ #include "agent.h"

#include "memory_agent.h"
#include <atomic>
#include <stdexcept>

@@ -7,0 +9,0 @@ namespace Agent {