Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noamt/password-masker
A Go library that masks passwords in text
https://github.com/noamt/password-masker
go security
Last synced: 16 days ago
JSON representation
A Go library that masks passwords in text
- Host: GitHub
- URL: https://github.com/noamt/password-masker
- Owner: noamt
- License: mit
- Created: 2019-04-05T13:04:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-10T07:46:11.000Z (over 5 years ago)
- Last Synced: 2024-06-20T09:15:19.857Z (6 months ago)
- Topics: go, security
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.asciidoc
- License: LICENSE
Awesome Lists containing this project
README
= Go Password Masker
image:https://travis-ci.org/noamt/password-masker.svg?branch=master["Build Status", link="https://travis-ci.org/noamt/password-masker"]
A library that helps you mask passwords within strings.
It identifies common password patterns such as:
`password: abcdef123456789`
`pass=abcdef123456789`
and
```
password:
abcdef123456789
```And replaces them with `\****`:
```
password:
****
```== Usage
To mask a password within a string:
```
containsPass := "password: nonofyourbusiness"
masked := mask.Password(containsPass)
println(masked) // password: ****
```You can also select your own mask:
```
containsPass := "password: nonofyourbusiness"
masked := mask.Password(containsPass, "????")
println(masked) // password: ????
```