ssh1blowfish

package
v0.0.0-...-e129ffb Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: BSD-3-Clause Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

type Cipher struct {
	blowfish.Cipher
}

A Cipher is an instance of SSHv1 Blowfish encryption using a particular key.

func NewCipher

func NewCipher(key []byte) (*Cipher, error)

NewCipher creates and returns a Cipher. The key argument should be the Blowfish key, from 1 to 56 bytes.

func (*Cipher) BlockSize

func (c *Cipher) BlockSize() int

BlockSize returns the Blowfish block size, 8 bytes. It is necessary to satisfy the Block interface in the package "crypto/cipher".

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(dst, src []byte)

Decrypt decrypts the 8-byte buffer src using the key k and stores the result in dst.

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(dst, src []byte)

Encrypt encrypts the 8-byte buffer src using the key k and stores the result in dst. Note that for amounts of data larger than a block, it is not safe to just call Encrypt on successive blocks; instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).

Jump to

Keyboard shortcuts

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