wumansgy / goencrypt Goto Github PK
View Code? Open in Web Editor NEWgo语言封装的各种对称加密和非对称加密,可以直接使用,包括3重DES,AES的CBC和CTR模式,还有RSA非对称加密,ECC椭圆曲线的加密和数字签名
go语言封装的各种对称加密和非对称加密,可以直接使用,包括3重DES,AES的CBC和CTR模式,还有RSA非对称加密,ECC椭圆曲线的加密和数字签名
Rsa 加密相同内容,密文不同,如何使加密相同内容,密文也一样呢
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的CBC模式加密后的密文为: ca50cdf49d7be7153286c34f6a4a678a10c41dd2c635989832b034df559cb74b76bc5e9ab6055a19efcd8afe58b27f528c078c4006c27d2f1cf7fab4be3bae641b2ede777ec15cd62bc8de96cf8a16293358f91f3dcf27bdae91dfd307fc0cc0a2c71fc198bf12be64166ef9c2f3309ef839ca6f0571882b7d77260d295beab2c9ce39382e1b2b3d3ed8f017093c6369c0ded230fe2a8c26d348ddb0f7162e05
两个加密出来不一样,能请问这是什么原因?
你好, 请问要不要考虑兼容 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);
报错
error: crypto/cipher: input not full blocks
大佬,可能是一个非常简单且愚蠢的问题:既然椭圆曲线上代数计算满足结合律,那么是否可以用快速幂算法(时间复杂度是对数级别的)来计算某个大数k对应的值?反过来,在知道kP和P的前提下,要反推k,无法使用快速幂算法,没有比挨个尝试更快的方法了(几乎是不可能的),不知道我理解的对吗?
最新的修改需要新打个release tag,当前导包默认引入的1.0.0没有包含最新的修改,有些新加的方法用不了
你好,可以做一个iv的接口吗 ,里面的iv写死了,
作者大大,有个问题。
func TripleDesEncrypt(plainText ,key []byte,ivDes...byte)([]byte,error){
3des 的iv参数是不是应该传 []byte 类型。
PKCS7格式的rsa签名
直接go get的代码比github上的少了很多,是不是手动改过版本号o
像 aes.AesCtrEncryptBase64 这类方法都没有
得这样才能拉到最新的代码
go get github.com/wumansgy/goEncrypt@master
到函数里面最后也是[]byte来操作的,传byte这个类型不好搞啊,还有能不能也支持多种填充模式啊,默认也是写死的PKCS5Padding
你好,以下这些函数是否未实现啊?
goEncrypt.GetFileStringHash256
goEncrypt.GetStringHash256
goEncrypt.GetFileStringHash512
goEncrypt.GetStringHash512
goEncrypt.GetFileHash256
goEncrypt.GetFileHash512
goEncrypt.GetHash256
goEncrypt.GetHash512
AES CBC 怎么选择填充方式,比如使用PKCS7Padding?
谢谢
thank you for sharing
if len(key)!=16{
return nil,ErrKeyLengthSixteen
}
can I remove this code and enable AES-192/256?
go: github.com/wumansgy/[email protected]: reading https://goproxy.io/github.com/wumansgy/go%21encrypt/@v/v2.0.0.info: 404 Not Found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.