Skip to content

Commit

Permalink
docs: fix the readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal committed Feb 10, 2024
1 parent 9cea50b commit 93f4d5a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SHELL ?= /bin/bash -euo pipefail
MAKEFLAGS += --warn-undefined-variables
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
CGO_ENABLED ?= $(shell go env CGO_ENABLED)
Expand Down
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,43 @@
A password generator for PostgreSQL
===============================================================================

This is a password generator for PostgreSQL.
It encrypts a raw string with SCRAM-SHA-256.
This is a password-encryption tool for PostgreSQL with SCRAM-SHA-256.

## Installation
Please download a executable file from [release pages](https://github.com/supercaracal/scram-sha-256/releases).
Please download an executable file from [release pages](https://github.com/supercaracal/scram-sha-256/releases).

## Usage
```
$ /tmp/scram-sha-256
$ scram-sha-256
Raw password:
SCRAM-SHA-256$4096:Wj5Wd30IrYzvZxJJ5NSuNg==$27HbcXbdKQd55FvzhEFq8DpPKQBRCvcnOOYFJ07Fr7s=:CibjLDWHtzbFjhSejBWcRkRGmuB2njOC8GxDh3gSwrE=
```

```
$ /tmp/scram-sha-256 mysecret
$ scram-sha-256 mysecret
SCRAM-SHA-256$4096:1Iuyc2XTVSv/GFgCWSv9Xw==$nU96dFyIuV+uWwiOly7HU5yinIJh55GsItyFAYrU2sc=:fEC668A2ufIsGS+9WC8xqD0hHvHQBbLiDxZ8hWlwkCw=
```

```go
import "github.com/supercaracal/scram-sha-256/pkg/pgpasswd"

func doSomething(rawPassword []byte) error {
encrypted, err := pgpasswd.Encrypt(rawPassword)
if err != nil {
return err
}

// do something
return nil
}
```

## Build locally
```
$ git clone https://github.com/supercaracal/scram-sha-256.git
$ cd scram-sha-256/
$ make
$ ./encrypt
$ ./cmd/tool/encrypt
Raw password:
SCRAM-SHA-256$4096:Mg8UNqSaPstxvBVRVYPQTw==$Zl7Rhln+rus3z+4YwC+7CgL/uKSUvqWH8mHMUizh1EI=:G9dSawW20CNLxTnZdcwHEHg9U9hG2noNEV2/t7ptq3s=
```
Expand Down

0 comments on commit 93f4d5a

Please sign in to comment.