所属公司: 无
开发角色: 独立全栈
项目状态: 已支持主网使用, 仅处理bug修复
项目地址: https://github.com/refitor/selfcrypto
在线地址: https://refitor.github.io/selfcrypto
技术栈
- 合约: solidity/openzeppelin/remix/infura/hardhat/ganache
- 后端: golang/WebAssembly, TOTP/AES/ECDSA
- 前端: html/js/css, vue/iview, web3.js/web3Modal/walletConnect, WebAssembly
SelfCrypto
SelfCrypto通过合约维护密钥的形式为数据加解密提供去中心化密钥管理和私有动态授权的解决方案,支持google动态授权后,进行在线文本数据加解密服务
合约
goerli, 5: 0x5e2200656e30d04c936fc0af995E6c51F6EAA96B
opbnb, 5611: 0x304eBa9f694f5a44Ddaa48aa4481Bf08AB0bE09B
mainnet, 1: ~0xec04F8Ee0493f3d763AB1624BB6aAcaCD94Ac4C1~
架构

- 合约: 负责存储web3密钥和后端私钥, 以及用于重置google动态授权的恢复ID
- 钱包:负责与合约交互,每次从合约提取密钥数据,需要动态生成签名由合约校验
- 动态授权: 由前端触发的的动态授权用于保证加解密必须由前后端协作才能完成
- 在线加解密: 作为在线加解密工具,支持用户输入或者导入文本数据进行在线加解密
- 混合加解密: 前端部分负责加解密明文,后端部分处理密文,密钥分离以及双层混合加密保证明文数据高度安全
- 加密数据托管: 官方提供key/value以及文件等形式的密文数据托管,授权密钥管理,以及在线可视化加解密等服务
需求
- 1. web3钱包私钥和助记词频繁丢失,巨额资金被盗,存在巨大风险
- 2. 大量的中心化软件和服务需要用户管理密码的方式,太过于繁琐和不安全
- 3. 主机安全防护措施无法完全防止黑客入侵,直接密文存储,彻底无法解密操作明文
特性
- web3合约; 去中心化存储管理混合加密部分密钥由合约保证防篡改
- web2后端: google动态授权认证和授权恢复动态验证保证必须本人操作
- 数据管理: 仅提供混合加解密服务作为在线工具,数据明文和密文由用户自行管理
安全性
- web3: 由区块链公链合约支持去中心化环境的防篡改特性(开源到github)
- web2: 仅仅作为动态授权和混合加解密工具,编译为wasm二进制文件嵌入web(开源到github)
- 前端: 仅仅作为与合约交互和在线加解密工具,需要通过google动态授权与后端协作(开源到github)
- 密钥: 密钥采用web3合约 + web2动态计算的方式维护,保证钱包账户和后端任何一方都无法单独获取明文
- 数据: 数据采用web3 + web2混合加密的方式由用户自行保管,保证钱包账户和后端任何一方都无法单独获取明文
私有部署
- install: git, go, npm, yarn
- 1. clone: git clone https://github.com/refitor/selfcrypto.git
- 2. contract: 自行通过remix或者其他工具部署即可
- 3. website: cd selfcrypto && ./build.sh, website源码将自动构建在selfcrypto目录
注意
- All official contract addresses are deployed using the open source version source code. All addresses will be updated synchronously in the github document, and the home page will be automatically displayed at the same time. Please make sure that the addresses are consistent
- Since the backend part needs to be compiled into wasm and embedded in the web, please be sure to use the only online site built with the official open source version: https://refitor.github.io/selfcrypto
- Cases that require private deployment: The public key that participates in the dynamic calculation of the google authorization key is the user wallet public key by default, and the key will not change after the recovery operation is performed to reset the google authorization. If you need to specify another public key or not If you hope that the google authorization key will not change, you need to specify the public key and private deployment to rebuild
- selfCrypto currently supports EIP-712, supported: goerli, opbnb, mainnet: After upgrading to EIP-712, it is no longer available, if you choose private deployment, you can maintain the public key c_public_hex for private deployment: selfcrypto/backend/wasm/user.go
Usage
Network
georli测试网仅用于加解密功能测试,正式使用请选择以太坊主网mainnet
Register
注册用于在合约内部初始化当前钱包账户,需要用户输入恢复ID(邮箱)
Recovery
恢复用于重置后端,需要输入收到的动态随机验证码
Encrypt-Decrypt
google动态授权通过后,进入在线加解密页面,仅仅对输入的文本数据或者上传的文本文件进行加解密操作,前后端以及合约都不进行存储