mangerattack

package
v0.0.0-...-5424261 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2018 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Overview

This contains modified copies of some of the code from the Go crypto package all credits goes to The Go Authors, it follows a BSD-style licence that can be found in the GO_LICENSE file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBase16

func FromBase16(base16 string) *big.Int

fromBase16 returns a new Big.Int from an hexadecimal string, as found in the go crypto tests suite

func MangerAttack

func MangerAttack(toDecrypt string, N, e *big.Int, ourOracle Oracle) string

See the 2 modifications made in rsa.go and the file utils.go to get a better understanding.

Types

type Oracle

type Oracle interface {
	// `Decrypt(*big.Int)` function that will send the said big Integer to the oracle
	Decrypt(*big.Int)
	// Query() bool will provide your oracle's answer whether the decrypted plaintext is >= B (true, then is has no leading 0 after decryption) or not (false, it has one or more leading zeros after decryption).
	Query() bool
}

Oracle is an interface to allow anyone to easily provide its own oracle queries. The Decrypt function is provided with the modified ciphertext we want the oracle to be fed with, while the Query function is returning the bool we need to attack.

Jump to

Keyboard shortcuts

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