doueta6642
2016-09-06 10:50如何在Golang中使用AES256-GCM加密文件?
AES256-GCM could be implemented in go as https://gist.github.com/cannium/c167a19030f2a3c6adbb5a5174bea3ff
However, Seal
method of interface cipher.AEAD
has signature:
Seal(dst, nonce, plaintext, additionalData []byte) []byte
So for very large files, one must read all file contents into memory, which is unacceptable.
A possible way is to implement Reader
/Writer
interfaces on Seal
and Open
, but shouldn't that be solved by those block cipher "modes" of AEAD? So I wonder if this is a design mistake of golang cipher lib, or I missed something important with GCM?
- 点赞
- 回答
- 收藏
- 复制链接分享
2条回答
为你推荐
- Python中的AES-GCM解密
- python
- encryption
- 1个回答
- 在Java和golang中使用AES时获得不同的结果(密文)
- java
- aes
- 1个回答
- 如何在Golang中使用rsa密钥对进行AES加密和解密
- cryptography
- rsa
- aes
- encryption
- 1个回答
- 用Golang解密用Java加密的内容(无iv)
- java
- encryption
- 1个回答
- 从PHP到Golang的aes-256-gcm解密
- openssl
- encryption
- php
- 1个回答
换一换