cpaes

package
v0.0.0-...-f06de04 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Code in this file solves challenge 17 of set 3 of the Cryptopals.

Code in this file solves challenge 12 and 14 of set 2 of the Cryptopals.

Code in this file is an alternative implementation of the byte-at-a-time attack that I found in the wild. It's a smarter solution, and is about 18% faster than the other one (less memory usage, too). This is a port of the original solution in Python.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptCTR

func DecryptCTR(input, key []byte, nonce uint64) ([]byte, error)

DecryptCTR decrypts the input byte slice using AES in CTR mode with the given key and nonce.

func EncryptCTR

func EncryptCTR(input, key []byte, nonce uint64) ([]byte, error)

EncryptCTR encrypts the input byte slice using AES in CTR mode with the given key and nonce.

Types

type Block

type Block [aes.BlockSize]byte

type Oracle

type Oracle func([]byte) []byte

Oracle is a type that encrypts/decrypts a given plain/cipher text using AES. The function does not modify the input slice.

Jump to

Keyboard shortcuts

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