Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task56 基于fisco账户体系,使用公钥加密AES密钥并分发。再使用AES加密数据进行上链 #3659

Open
wants to merge 1 commit into
base: dev-2.0
Choose a base branch
from

Conversation

JcobCN
Copy link
Contributor

@JcobCN JcobCN commented May 30, 2023

自定义任务

基于 fisco bcos2.0;go语言

使用2.0的账户体系的ECC非对称加密密钥(.pem文件),在保护各方密钥安全的情况下,收集公钥提供给合约的主导者,使用公钥加密AES密钥,再分发给各个使用者。

在加密速度(对称加密速度非常快)和安全性之间,取得了平衡。加密后的数据上链,合约使用方可以加密共享数据,保证了数据的安全性。

3.0理论上也适用,未测试。

}
ecdsaPub, ok := tempPubKey.(*ecdsa.PublicKey)
if ok == false {
fmt.Errorf("断言失败=\n")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error strings should not be capitalized or end with punctuation or a newline

fmt.Println(hex.EncodeToString(pubB))
tempPubKey, err := x509.ParsePKIXPublicKey(pubB)
if err != nil {
fmt.Errorf("x509 pubKey %v\n", err)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error strings should not be capitalized or end with punctuation or a newline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants