oxicrypt

package module
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 10 Imported by: 1

README

Build

Go Report Card

QA

Quality Gate Status Reliability Rating Maintainability Rating

Security

Security Rating Vulnerabilities

OxiPass Encryption Library

Encryption package with implementation of multiple standard encryption algorithms

Documentation

Index

Constants

View Source
const AES256Id = cCryptIDAES25601
View Source
const AES256Text = cAES256TextDescription
View Source
const NoneId = cNoneId
View Source
const NoneText = cNoneDescription
View Source
const OXICRPT001encKeyIsNotSet = "OXICRPT001: Encryption key is not created, encryption/decryption is not possible"

OXICRPT001encKeyIsNotSet - OXICRPT001: Password is not set, encryption/decryption is not possible

View Source
const OXICRPT002wrongKeyLength = "OXICRPT002: key length is wrong"

OXICRPT002wrongKeyLength - OXICRPT002: key length is wrong

View Source
const OXICRPT003cipherNotFound = "OXICRPT003: cipher is not found"

OXICRPT003cipherNotFound - OXICRPT003: cipher is not found

Variables

This section is empty.

Functions

This section is empty.

Types

type CipherInfo added in v1.0.8

type CipherInfo struct {
	ID          string
	Description string
}

func GetCiphers added in v1.0.8

func GetCiphers() (ci []CipherInfo)

type OxiCipher added in v1.0.8

type OxiCipher interface {
	CleanAndInit() // Full clean and initialization of the entity

	// SetPassword  should be called before using encryption
	SetPassword(string) error    // Password should be set before starting encryption/decryption
	SetPasswordKey([]byte) error // Setting key from bytes array
	GetPasswordKey() []byte      // Get password current key
	IsPasswordSet() bool         // Check if password is set and entity is ready to work

	Encrypt(string) (string, error) // Encrypt string, return encrypted base64 string
	Decrypt(string) (string, error) // Decrypt string, encrypted base64 string should be provided as input

	EncryptBLOB(string) ([]byte, error) // Encrypt string, return encrypted bytes
	DecryptBLOB([]byte) (string, error) // Decrypt encrypted bytes, return string

	EncryptBIN([]byte) ([]byte, error) // Encrypt bytes array, return encrypted bytes
	DecryptBIN([]byte) ([]byte, error) // Decrypt encrypted bytes, return bytes array

	GetCryptID() string    // Unique ID of cipher implementation, use any alphanumeric symbols, 8 chars
	GetCipherName() string // Human readable name of the implemented cypher
}

OxiCipher - Cipher interface, implement all the methods to attach new cipher to storage

func GetOxiCipher added in v1.0.8

func GetOxiCipher(cipherId string) (OxiCipher, error)

GetOxiCipher - ciphers factory, get the object here

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL