Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/tokopedia/cryptography-example

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/tokopedia/cryptography-example

  • v0.0.0-20231208041519-c0a4f5457ca0
  • Source
  • Go
  • Socket score

Version published
Created
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

Package last updated on 08 Dec 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc