Skip to content

Instantly share code, notes, and snippets.

@nape1
nape1 / crypto-aes-gcm.js
Created May 2, 2024 06:51 — forked from chrisveness/crypto-aes-gcm.js
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@nape1
nape1 / Multiple SSH accounts
Last active September 21, 2023 09:58 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts
# Setup SSH keys for multiple github and gitlab account
## Prepare SSH keys:
Add a new key
```
$ ssh-keygen -t rsa_new -C "your_email@youremail.com"
```
Start ssh-agent
```
$ eval `ssh-agent -s`
@nape1
nape1 / Diagrams.md
Last active July 13, 2023 10:05 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC
graph LR
  linkStyle default fill:#ffffff

  subgraph diagram [Software System - Containers]
    style diagram fill:#ffffff,stroke:#ffffff

    1["<div style='font-weight: bold'>User</div><div style='font-size: 70%; margin-top: 0px'>[Person]</div>"]
    style 1 fill:#08427b,stroke:#052e56,color:#ffffff