vault_go

package
v0.0.0-...-1b05b80 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const BLOCK_SIZE = 16

AESにおける1ブロックあたりのバイト数

View Source
const FILE_HEADER_11 = "$ANSIBLE_VAULT;1.1;AES256"

Ansible Vaultヘッダ(1.1)

View Source
const FILE_HEADER_12 = "$ANSIBLE_VAULT;1.2;AES256;"

Ansible Vaultヘッダ(1.2)

View Source
const FILE_HEADER_PATTERN = "\\A\\$ANSIBLE_VAULT;1\\.\\d;AES(?:256)?(?:;.+)?"

Ansible Vaultヘッダを表す正規表現

View Source
const IV_LENGTH = 16

Initialization Vectorの長さ

View Source
const KDF_ITERATIONS = 10000

共通鍵生成時の繰り返し回数

View Source
const KEY_LENGTH = 32

共通鍵・HMAC鍵の長さ

View Source
const LINE_PER_CHARS = 80

一行あたりの文字数

Variables

View Source
var HASH_ALGORITHM = sha256.New

共通鍵・HMACを作成する際のハッシュ関数名

Functions

func CalcHMAC

func CalcHMAC(cipherText, hmacKey []byte) string

16進ハッシュ文字列を生成する

func CreateSalt

func CreateSalt() ([]byte, error)

ソルト値をランダム生成する

func Decrypt

func Decrypt(text, password string) (string, []byte, error)

復号化を行う

func Derivekeys

func Derivekeys(password string, salt []byte) (cipherKey, hmacKey, iv []byte)

鍵を生成する

func Encrypt

func Encrypt(text, password, label string, srcSalt []byte) (string, error)

暗号化を行う

func ThroughCipher

func ThroughCipher(src, cipherKey, iv []byte) ([]byte, error)

暗号化・復号化を交互に行う

Types

This section is empty.

Jump to

Keyboard shortcuts

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