Git Product home page Git Product logo

koso2's Introduction

Koso x Koso

Encrypt message using public key of user with specified GitHub id.
Encrypted message can be processed by your Go program.
Inspired by naisho !

⚠Currently, only RSA is supported.

Usage

Encrypt

package main

import (
	"bytes"
	"fmt"
	"io"
	"os"

	"github.com/ddddddO/koso2"
)

func main() {
	ghUserID := "ddddddO"
	plainMessage := `こんにちは!
Hello!
Halo!
Bonjour!
你好!
안녕하세요!
habari!
`

	callback := func(encrypted string) error { // 'encrypted' is the encrypted plainMessage.
                fmt.Print(encrypted) // For example, we could add processing to send encrypted message to Slack.
		return nil
	}

	if err := koso2.Run(ghUserID, plainMessage, callback); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}

Decrypt

$ openssl pkeyutl -decrypt -in <Encrypted Message File> -inkey ~/.ssh/id_rsa \
    -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256

Install

Package

$ go get github.com/ddddddO/koso2

CLI

Currently, this CLI only has function of encrypting message with public key of specified GitHub ID and outputting it to standard output.

$ go install github.com/ddddddO/koso2/cmd/koso2@latest

Miscellaneous

Multiple callbacks

err := koso2.Run(ghUserID, plainMessage, callback1, callback2, callback3)

Multiple callbacks concurrently

err := koso2.RunConcurrently(ghUserID, plainMessage, callback1, callback2, callback3)

koso2's People

Contributors

ddddddo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.