https://github.com/dentrax/obscure-go
In-memory security with secure data types
https://github.com/dentrax/obscure-go
data-type in-memory-security memory-safety memory-security obscure obscure-code
Last synced: 8 months ago
JSON representation
In-memory security with secure data types
- Host: GitHub
- URL: https://github.com/dentrax/obscure-go
- Owner: Dentrax
- License: mit
- Created: 2020-08-07T19:41:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-20T18:11:00.000Z (about 5 years ago)
- Last Synced: 2025-01-03T01:40:34.694Z (9 months ago)
- Topics: data-type, in-memory-security, memory-safety, memory-security, obscure, obscure-code
- Language: Go
- Homepage: https://medium.com/trendyol-tech/secure-types-memory-safety-with-go-d3a20aa1e727
- Size: 20.5 KB
- Stars: 16
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
obscure-go
[W.I.P] In-memory secure types framework for Go.
# Supports
> * SecureInteger
> * SecureString# Usage
## Importing
```go
import (
secure "github.com/Dentrax/obscure-go/types"
)
```## Creating
```go
secInt := secure.NewInt(15)
secStr := secure.NewString("foo")
```## Hack Detecting
```go
// Importing
import (
secure "github.com/Dentrax/obscure-go/types"
)// Creating
w := obs.CreateWatcher("watcher")// Attaching
secInt.AddWatcher(w)
secStr.AddWatcher(w)
```# Function Interfaces
## Integer
```go
type ISecureInt interface {
Apply() ISecureInt
AddWatcher(obs obs.Observer)
SetKey(int)
Inc() ISecureInt
Dec() ISecureInt
Set(int) ISecureInt
Get() int
GetSelf() *SecureInt
Decrypt() int
RandomizeKey()
IsEquals(ISecureInt) bool
}
```## String
```go
type ISecureString interface {
Apply() ISecureString
AddWatcher(obs obs.Observer)
SetKey(int)
Set(string) ISecureString
Get() string
GetSelf() *SecureString
Decrypt() []rune
RandomizeKey()
IsEquals(ISecureString) bool
}
```# Example
* Non-Secure
```bash
$ go run ./examples/games/nonsecure/game_nonsecure.go
```* Secure
```bash
$ go run ./examples/games/secure/game_secure.go
```# License
The base project code is licensed under _MIT License_ unless otherwise specified. Please see the **[LICENSE](https://github.com/Dentrax/obscure-go/blob/master/LICENSE)** file for more information.
# Copyright
_obscure-go_ was created by Furkan ([Dentrax](https://github.com/Dentrax))
obscure-go