GithubHelp home page GithubHelp logo

jasonzz-he / ige-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from midnight-wonderer/ige-go

0.0 1.0 0.0 180 KB

add Infinite Garble Extension mode of operation support to golang

License: MIT No Attribution

Go 100.00%

ige-go's Introduction

###IGE-go My favorite cryptography mode of operation scheme for the block cipher, Infinite Garble Extension. It is not good for general purpose message authentication though. Since you are here I guess you know why and when to use IGE mode but if not just Google it for more info.

###Install go get github.com/MidnightWonderer/IGE-go/ige

###Example Usage

package main

import (
	"crypto/aes"
	"encoding/hex"
	"fmt"
	"github.com/MidnightWonderer/IGE-go/ige"
)

func main() {
	aesKey, _ := hex.DecodeString("5468697320697320616E20696D706C65")
	aesBlock, _ := aes.NewCipher(aesKey)
	igeIV, _ := hex.DecodeString("6D656E746174696F6E206F6620494745206D6F646520666F72204F70656E5353")
	igeEnc := ige.NewIGEEncrypter(aesBlock, igeIV)
	crypttext, _ := hex.DecodeString("99706487A1CDE613BC6DE0B6F24B1C7AA448C8B9C3403E3467A8CAD89340F53B")
	fmt.Printf("%s\r\n", hex.EncodeToString(crypttext))
	igeEnc.CryptBlocks(crypttext, crypttext)
	fmt.Printf("%s\r\n", hex.EncodeToString(crypttext))
	//print:
	//99706487a1cde613bc6de0b6f24b1c7aa448c8b9c3403e3467a8cad89340f53b
	//4c2e204c6574277320686f70652042656e20676f74206974207269676874210a
	//test vector:
	//https://web.archive.org/web/20120418022623/http://www.links.org/files/openssl-ige.pdf
}

###etc. IGE-go was placed under The MIT-Zero License. Contribution back is encouraged.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.