cryptography

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2017 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Ransomware example in Golang Copyright (C) 2017 Gustavo Henrique

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

Ransomware example in Golang Copyright (C) 2017 Gustavo Henrique

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

Ransomware example in Golang Copyright (C) 2017 Gustavo Henrique

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

Ransomware example in Golang Copyright (C) 2017 Gustavo Henrique

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

Ransomware example in Golang Copyright (C) 2017 Gustavo Henrique

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

Index

Constants

View Source
const (
	RSW_PREFIX   string     = "_fck_"
	RSW_HTML     string     = "rsw_welcome.html"
	ENCRYPT_MODE CipherMode = iota
	DECRYPT_MODE
)

Variables

This section is empty.

Functions

func CopyFileMetadata

func CopyFileMetadata(srcFileInfo os.FileInfo, destFile string) error

func DecryptDir

func DecryptDir(dirPath string, config ServerConfig) error

func EncryptDir

func EncryptDir(dirPath string, config ServerConfig) error

func Exists

func Exists(name string) bool

func GenSharedKey

func GenSharedKey(privKey *ecdsa.PrivateKey, pubKey *ecdsa.PublicKey) ([]byte, error)

func GenerateECDSAPrivateKey

func GenerateECDSAPrivateKey() (*ecdsa.PrivateKey, error)

func GetCipherBlockMode

func GetCipherBlockMode(key []byte, mode CipherMode) (cipher.BlockMode, error)

func ToHex

func ToHex(num *big.Int) string

func WalkFuncDecorator

func WalkFuncDecorator(walkFn filepath.WalkFunc) filepath.WalkFunc

Types

type CipherMode

type CipherMode int

type CipheredFileInfo

type CipheredFileInfo struct {
	PubKey    *ecdsa.PublicKey
	HeaderLen int
}

type PrivKey

type PrivKey struct {
	D string `json:"D"`
}

func GetOrCreatePrivKey

func GetOrCreatePrivKey(ecdsaPrivKey *ecdsa.PrivateKey, file string) PrivKey

type PubKey

type PubKey struct {
	X string `json:"X"`
	Y string `json:"Y"`
}

func GetOrCreatePubKey

func GetOrCreatePubKey(ecdsaPrivKey *ecdsa.PrivateKey, file string) PubKey

type ServerConfig

type ServerConfig struct {
	PubKey  PubKey  `json: "pubKey"`
	PrivKey PrivKey `json: "privKey"`
}

Jump to

Keyboard shortcuts

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