goCipherBlockSerializer

package module
v0.0.0-...-c815b92 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

CipherBlock Serializer (In development)

Overview

The CipherBlock Serializer is a Go library designed to serialize and deserialize cryptographic cipher blocks (cipher.Block) into byte slices ([]byte). This functionality is particularly useful for embedding cryptographic cipher configurations directly into code, facilitating secure, hardcoded cryptographic setups.

Features

  • Serialize Cipher Blocks: Convert any cipher.Block into a byte slice, capturing the exact state and configuration of the cipher.
  • Deserialize Cipher Blocks: Reconstruct a cipher.Block from a byte slice, ensuring that the cryptographic properties are retained.
  • Support for Multiple Key Sizes: Compatible with AES-128, AES-192, and AES-256 key sizes.

Installation

To install CipherBlock Serializer, use the following go get command:

go get -u github.com/RafOSS-br/go-cipher-block-serializer

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(block Block, cipherType reflect.Type) (cipher.Block, error)

Deserialize deserializes a byte slice to a cipher.Block.

Types

type Block

type Block struct {
	Enc []uint32
	Dec []uint32
}

func NewBlockFromJson

func NewBlockFromJson(reader io.ByteReader) (Block, error)

FromJSON reads a JSON and returns a Block.

func Serialize

func Serialize(cipherBlock cipher.Block) (Block, error)

Serialize serializes a cipher.Block to a byte slice.

func (Block) Json

func (b Block) Json(f io.Writer) error

Json writes the JSON representation of a Block.

Jump to

Keyboard shortcuts

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