padding

package
v6.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package padding implements PKCS7 padding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PKCS7

type PKCS7 struct {
	// contains filtered or unexported fields
}

PKCS7 implements PKCS7 padding for block ciphers.

func NewPKCS7

func NewPKCS7(blockSize int) *PKCS7

NewPKCS7 creates a new PKCS7 instance with the specified block size.

func (*PKCS7) Pad

func (p *PKCS7) Pad(plainData []byte) []byte

Pad adds PKCS7 padding to plainData and returns the padded data.

func (*PKCS7) UnPad

func (p *PKCS7) UnPad(encryptedData []byte) []byte

UnPad removes PKCS7 padding from encryptedData and returns the unpadded data.

Jump to

Keyboard shortcuts

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