GithubHelp home page GithubHelp logo

wumansgy / goencrypt Goto Github PK

View Code? Open in Web Editor NEW
732.0 14.0 169.0 431 KB

go语言封装的各种对称加密和非对称加密,可以直接使用,包括3重DES,AES的CBC和CTR模式,还有RSA非对称加密,ECC椭圆曲线的加密和数字签名

Go 100.00%
des 3des aes rsa ecc crypt gocrypt

goencrypt's People

Contributors

wumansgy avatar yohox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goencrypt's Issues

runtime err: runtime error: invalid memory address or nil pointer dereference Check that the key is correct

runtime err: runtime error: invalid memory address or nil pointer dereference Check that the key is correct

cryptText,_:=goEncrypt.RsaEncrypt([]byte("aaa"),[]byte{ 48, 129, 159, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 129, 141, 0, 48, 129, 137, 2, 129, 129, 0, 193, 227, 147, 77, 22, 20, 70, 91, 51, 5, 62, 127, 72, 238, 78, 200, 123, 20, 185, 94, 248, 137, 71, 113, 61, 37, 238, 203, 255, 126, 116, 199, 151, 125, 2, 220, 29, 148, 81, 247, 157, 213, 209, 193, 12, 41, 172, 182, 169, 180, 214, 251, 125, 10, 2, 121, 182, 113, 158, 23, 114, 86, 95, 9, 175, 98, 119, 21, 145, 146, 33, 174, 249, 24, 153, 202, 224, 140, 13, 104, 109, 116, 139, 32, 163, 96, 59, 226, 49, 140, 166, 188, 43, 89, 112, 101, 146, 169, 33, 157, 11, 240, 92, 159, 101, 2, 58, 33, 210, 51, 8, 7, 37, 42, 224, 6, 109, 89, 206, 239, 165, 242, 116, 142, 168, 11, 171, 129, 2, 3, 1, 0, 1 })
fmt.Println(cryptText)

AES 256 CBC 加密出来的内容不一样

通过这个网站在线加密出来的内容如下
图片
图片
AES的CBC模式加密后的密文为: ca50cdf49d7be7153286c34f6a4a678a10c41dd2c635989832b034df559cb74b76bc5e9ab6055a19efcd8afe58b27f528c078c4006c27d2f1cf7fab4be3bae641b2ede777ec15cd62bc8de96cf8a16293358f91f3dcf27bdae91dfd307fc0cc0a2c71fc198bf12be64166ef9c2f3309ef839ca6f0571882b7d77260d295beab2c9ce39382e1b2b3d3ed8f017093c6369c0ded230fe2a8c26d348ddb0f7162e05

两个加密出来不一样,能请问这是什么原因?

AES: 兼容crypto-js

你好, 请问要不要考虑兼容 https://github.com/brix/crypto-js 中的 AES 加解密?

官方示例:

var CryptoJS = require("crypto-js");

// Encrypt
var ciphertext = CryptoJS.AES.encrypt('my message', 'secret key 123').toString();
//                              注意, 加解密都没有指定 iv (iv是可选参数)^
//                           key的长度不必是 16/24/32 ^

// Decrypt
var bytes  = CryptoJS.AES.decrypt(ciphertext, 'secret key 123');
var originalText = bytes.toString(CryptoJS.enc.Utf8);

console.log(originalText);

ivdes问题

你好,可以做一个iv的接口吗 ,里面的iv写死了,

关于椭圆曲线加密算法的计算问题

大佬,可能是一个非常简单且愚蠢的问题:既然椭圆曲线上代数计算满足结合律,那么是否可以用快速幂算法(时间复杂度是对数级别的)来计算某个大数k对应的值?反过来,在知道kP和P的前提下,要反推k,无法使用快速幂算法,没有比挨个尝试更快的方法了(几乎是不可能的),不知道我理解的对吗?

跟pkg.go.dev上默认版本号的代码对不上

直接go get的代码比github上的少了很多,是不是手动改过版本号o
像 aes.AesCtrEncryptBase64 这类方法都没有

得这样才能拉到最新的代码
go get github.com/wumansgy/goEncrypt@master

报错

报错
error: crypto/cipher: input not full blocks

sha256和sha512问题

你好,以下这些函数是否未实现啊?
goEncrypt.GetFileStringHash256
goEncrypt.GetStringHash256
goEncrypt.GetFileStringHash512
goEncrypt.GetStringHash512
goEncrypt.GetFileHash256
goEncrypt.GetFileHash512
goEncrypt.GetHash256
goEncrypt.GetHash512

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.