npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hm-soft/enc

v0.1.0

Published

HMSOFT 복합 암호화 SDK (쓰기) — AES-256-GCM + ChaCha20-Poly1305 캐스케이드 + 키 회전

Readme

@hm-soft/enc

HMSOFT 복합 암호화 SDK — 쓰기(저장) 쪽. 표준 암호 위에 HMSOFT 고유 레이어를 얹은 다층(cascade) 구조로 민감 데이터를 암호화합니다.

평문
 ① AES-256-GCM            ← 절대 방어선 (키 없으면 못 풂)
 ② ChaCha20-Poly1305      ← 2차 표준 암호 (캐스케이드)
 ③ HMSOFT 키 기반 셔플      ← HMSOFT 고유 변환 레이어
 → "HMSOFT:v1:<keyId>:<base64url>" 토큰

복호화는 짝 패키지 @hm-soft/dec를 사용하세요.

설치

npm install @hm-soft/enc

사용

import { hmsoftEncrypt, hashPassword, loadKey, generateKey } from "@hm-soft/enc";

// 1) 마스터 키 한 번 생성 → 환경변수 HMSOFT_ENC_KEY 에 보관
//    node -e "import('@hm-soft/enc').then(m=>console.log(m.generateKey()))"

const key = loadKey(); // 환경변수에서 로드
await db.users.insert({
  ssn: hmsoftEncrypt("901010-1234567", key), // 민감정보 → 암호화
  pwHash: hashPassword(rawPassword),         // 비밀번호 → 해싱(복호화 불가)
});

키 회전 (선택)

HMSOFT_ENC_KEYS='{"v1":"<옛키 base64>","v2":"<새키 base64>"}'
HMSOFT_ENC_PRIMARY=v2
import { hmsoftEncrypt, loadKeyring } from "@hm-soft/enc";
const ring = loadKeyring();
const enc = hmsoftEncrypt("민감정보", ring); // 항상 primary 키로 암호화

API

| 함수 | 설명 | |------|------| | hmsoftEncrypt(text, key \| keyring) | 복합 암호화 → 토큰 문자열 | | hashPassword(password) | scrypt 단방향 해싱 (복호화 불가) | | loadKey(env?) | 단일 마스터 키(Buffer) 로드 | | loadKeyring(env?) | 키 회전용 키링 로드 | | generateKey() | 새 32바이트 키(base64) 생성 |

보안 원칙

  • 안전성은 코드가 아니라 키에서 나옵니다. 소스가 공개돼도 키 없이는 못 풉니다.
  • 마스터 키를 코드/깃/DB/로그에 절대 넣지 마세요.
  • 비밀번호는 암호화가 아니라 반드시 hashPassword()로 해싱하세요.

License

Apache-2.0