Socket
Socket
Sign inDemoInstall

github.com/tokopedia/cryptography-example

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/tokopedia/cryptography-example


Version published

Readme

Source

PREREQUISITE

There are 2 encryption on this example

  • Encrypt/Decrypt key: using RSA OAEP 256 encryption
  • Encrypt/Decrypt payload: using AES GCM encryption

Generate RSA Key Pair

Create a key directory int root folder

mkdir key
cd key

Generate 2048 bit RSA Key

openssl genrsa -des3 -out private.pem 2048

Export the RSA Private Key

openssl rsa -in private.pem -out priv.pem -outform PEM

Export the RSA Public Key

openssl rsa -in private.pem -outform PEM -pubout -out pub.pem

Remove the RSA Key

rm private.pem

HOW TO RUN

GO

cd go-example
go run ./main.go

PHP

cd php-example
composer install 
php main.php  

JAVA

cd java-example
mvn install
mvn exec:java -Dexec.mainClass="com.java.example.Example"

C#

cd c\#-example
dotnet run 

JS

cd js-example
npm install crypto --save 

Python

cd python-example
pip install -r requirements.txt
python main.py

FAQs

Last updated on 08 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc