• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

whs/ipfs-encrypted-share: IPFS Encrypted Share

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

whs/ipfs-encrypted-share

开源软件地址:

https://github.com/whs/ipfs-encrypted-share

开源编程语言:

JavaScript 99.5%

开源软件介绍:

IPFS Encrypted Share

Current version: 1.0.0

Encrypted file uploader for IPFS, similar to Mega

Security

This use libsodium, so it should be quite safe to use. However, I'm not a cryptography expert and this code is not audited, so use it at your own risk.

Technical details

Encryption

Files are encrypted with libsodium stream encryption. The encryption key are randomly generated every time and stored as urlsafe unpadded base64 in URL fragment (not transmitted to gateway or IPFS).

Metadata

File metadata is stored at /metadata.json. It contains 2 keys:

  • header: Stream header (from crypto_secretstream_xchacha20poly1305_init_push), base64 encoded without padding.
  • encryptedMetadata: Encrypted metadata, base64 encoded without padding.

The encrypted metadata is the first message in the stream. It is a JSON with the following keys:

  • filename: Original filename
  • size: File size in bytes
  • pieces: Number of file pieces

This message has the tag crypto_secretstream_xchacha20poly1305_TAG_FINAL.

File pieces

The file are splitted to pieces, each 5MB in size. (limited by libsodium.js heap size) They are encrypted and stored at /pieces/chunkId. ChunkID starts at 0 to encryptedMetadata.pieces - 1. File pieces share the same encryption stream with the metadata.

The final piece has the tag crypto_secretstream_xchacha20poly1305_TAG_FINAL. All other pieces has the tag 0.

License

Licensed under the MIT License




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap