rc4

package
v0.0.0-...-82e7740 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package rc4 implements RC4 encryption, as defined in Bruce Schneier's Applied Cryptography.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(src, key []byte) ([]byte, error)

Decrypt decrypts the first block in src into dst. Dst and src may point at the same memory.

Example
tt := rc4Tests[0]
dst, _ := rc4.Decrypt(tt.out, tt.key)
fmt.Println(bytes.Compare(tt.in, dst))
Output:

0

func DecryptHex

func DecryptHex(src, key string) (string, error)

DecryptHex decrypts the first block in src into dst.

Example
package main

import (
	"fmt"

	"gopkg.in/goyy/goyy.v0/util/crypto/rc4"
)

func main() {
	dst, _ := rc4.DecryptHex("6c034d94", "key")
	fmt.Println(dst)

}
Output:

goyy

func Encrypt

func Encrypt(src, key []byte) ([]byte, error)

Encrypt encrypts the first block in src into dst. Dst and src may point at the same memory.

Example
tt := rc4Tests[0]
dst, _ := rc4.Encrypt(tt.in, tt.key)
fmt.Println(bytes.Compare(tt.out, dst))
Output:

0

func EncryptHex

func EncryptHex(src, key string) (string, error)

EncryptHex encrypts the first block in src into dst.

Example
package main

import (
	"fmt"

	"gopkg.in/goyy/goyy.v0/util/crypto/rc4"
)

func main() {
	dst, _ := rc4.EncryptHex("goyy", "key")
	fmt.Println(dst)

}
Output:

6c034d94

Types

This section is empty.

Jump to

Keyboard shortcuts

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