Skip to content

Instantly share code, notes, and snippets.

View retalemine's full-sized avatar

Subhu.rys retalemine

  • Chennai, India
View GitHub Profile
@retalemine
retalemine / encrypt.ts
Created May 19, 2025 15:11
openpgp crypto
import fs = require("fs");
import openpgp = require('openpgp');
import { Readable } from "stream";
(async () => {
const { privateKey, publicKey } = await openpgp.generateKey({
type: 'rsa', // Type of the key
rsaBits: 4096, // RSA key size (defaults to 4096 bits)
userIDs: [{ name: 'Jon Smith', email: 'jon@example.com' }], // you can pass multiple user IDs