Skip to content

Instantly share code, notes, and snippets.

View atahani's full-sized avatar
😄

Ahmad Tahani atahani

😄
View GitHub Profile
@atahani
atahani / docker-compose.yaml
Created December 20, 2020 07:14
the elastic stack on the minimum version good for testing purpose
version: "3"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
import { randomBytes, publicEncrypt, createCipheriv, privateDecrypt, createDecipheriv } from 'crypto'
import { RSA_PKCS1_PADDING } from 'constants'
type EncryptResult = {
sign: string
encryptedRequestData: string
}
export const encryptWithPublicKey = (publicKey: string, requestData: Record<string, any>): EncryptResult => {
const secret = randomBytes(16).toString('hex')

Keybase proof

I hereby claim:

  • I am atahani on github.
  • I am atahani (https://keybase.io/atahani) on keybase.
  • I have a public key whose fingerprint is EA77 D2AD 9504 0ADF B9AA C7F5 9D55 D41A CFBF B280

To claim this, I am signing this object: