python加密库_(Python)同态加密深度学习库

Introduction

PySyft is a Python library for secure, private Deep Learning. PySyft decouples private data from model training, using Federated Learning, Differential Privacy, and Multi-Party Computation (MPC) within PyTorch. Join the movement on Slack.

PySyft in Detail

A more detailed explanation of PySyft can be found in the paper on arxiv

PySyft has also been explained in video form by Siraj Raval

Pre-Installation

Optionally, we recommend that you install PySyft within the Conda virtual environment. If you are using Windows, I suggest installing Anaconda and using the Anaconda Prompt to work from the command line.

conda create -n pysyft python=3

conda activate pysyft # some older version of conda require "source activate pysyft" instead.

conda install jupyter notebook

Installation

PySyft supports Python >= 3.6 and PyTorch 1.1.0

pip install syft

If you have an installation error regarding zstd, run this command and then re-try installing syft.

pip install --upgrade --force-reinstall zstd

If this still doesn't work, and you happen to be on OSX, make sure you have OSX command line tools installed and try again.

You can also install PySyft from source on a variety of operating systems by following this installation guide.

Run Local Notebook Server

All the examples can be played with by running the command

make notebook

and selecting the pysyft kernel

Use the Docker image

Instead of installing all the dependencies on your computer, you can run a notebook server (which comes with Pysyft installed) using Docker. All you will have to do is start the container like this:

$ docker container run openmined/pysyft-notebook

You can use the provided link to access the jupyter notebook (the link is only accessible from your local machine).

NOTE: If you are using Docker Desktop for Mac, the port needs to be forwarded to localhost. In that case run docker with: bash $ docker container run -p 8888:8888 openmined/pysyft-notebook to forward port 8888 from the container's interface to port 8888 on localhost and then access the notebook via http://127.0.0.1:8888/?token=...

You can also set the directory from which the server will serve notebooks (default is /workspace).

$ docker container run -e WORKSPACE_DIR=/root openmined/pysyft-notebook

You could also build the image on your own and run it locally:

$ cd docker-image

$ docker image build -t pysyft-notebook .

$ docker container run pysyft-notebook

More information about how to use this image can be found on docker hub

Try out the Tutorials

A comprehensive list of tutorials can be found here

These tutorials cover how to perform techniques such as federated learning and differential privacy using PySyft.

High-level Architecture

Start Contributing

The guide for contributors can be found here. It covers all that you need to know to start contributing code to PySyft in an easy way.

Also join the rapidly growing community of 5000+ on Slack. The slack community is very friendly and great about quickly answering questions about the use and development of PySyft!

Troubleshooting

We have written an installation example in this colab notebook, you can use it as is to start working with PySyft on the colab cloud, or use this setup to fix your installation locally.

Organizational Contributions

We are very grateful for contributions to PySyft from the following organizations!

Disclaimer

Do NOT use this code to protect data (private or otherwise) - at present it is very insecure. Come back in a couple months.

License

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
区块链起源于比特币,2008年11月1日,一位自称中本聪(Satoshi Nakamoto)的人发表了《比特币:一种点对点的电子现金系统》一文 4  ,阐述了基于P2P网络技术、加密技术、时间戳技术、区块链技术等的电子现金系统的构架理念,这标志着比特币的诞生。两个月后理论步入实践,2009年1月3日第一个序号为0的创世区块诞生。几天后2009年1月9日出现序号为1的区块,并与序号为0的创世区块相连接形成了链,标志着区块链的诞生 5  。近年来,世界对比特币的态度起起落落,但作为比特币底层技术之一的区块链技术日益受到重视。在比特币形成过程中,区块是一个一个的存储单元,记录了一定时间内各个区块节点全部的交流信息。各个区块之间通过随机散列(也称哈希算法)实现链接,后一个区块包含前一个区块的哈希值,随着信息交流的扩大,一个区块与一个区块相继接续,形成的结果就叫区块链 6  。什么是区块链?从科技层面来看,区块链涉及数学、密码学、互联网和计算机编程等很多科学技术问题。从应用视角来看,简单来说,区块链是一个分布式的共享账本和数据,具有去中心化、不可篡改、全程留痕、可以追溯、集体维护、公开透明等特点。这些特点保证了区块链的“诚实”与“透明”,为区块链创造信任奠定基础。而区块链丰富的应用场景,基本上都基于区块链能够解决信息不对称问题,实现多个主体之间的协作信任与一致行动 7  。区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),是比特币的一个重要概念,它本质上是一个去中心化的数据,同时作为比特币的底层技术,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次比特币网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块 8  。比特币白皮书英文原版 4  其实并未出现 blockchain 一词,而是使用的 chain of blocks。最早的比特币白皮书中文翻译版 9  中,将 chain of blocks 翻译成了区块链。这是“区块链”这一中文词最早的出现时间。国家互联网信息办公室2019年1月10日发布《区块链信息服务管理规定》,自2019年2月15日起施行 1  。作为核心技术自主创新的重要突破口,区块链的安全风险问题被视为当前制约行业健康发展的一大短板,频频发生的安全事件为业界敲响警钟。拥抱区块链,需要加快探索建立适应区块链技术机制的安全保障体系。 102008年由中本聪第一次提出了区块链的概念 4  ,在随后的几年中,区块链成为了电子货币比特币的核心组成部分:作为所有交易的公共账簿。通过利用点对点网络和分布式时间戳服务器,区块链数据能够进行自主管理。为比特币而发明的区块链使它成为第一个解决重复消费问题的数字货币。比特币的设计已经成为其他应用程序的灵感来源。2014年,区块链2.0”成为一个关于去中心化区块链数据的术语。对这个第二代可编程区块链,经济学家们认为它是一种编程语言,可以允许用户写出更精密和智能的协议 11  。因此,当利润达到一定程度的时候,就能够从完成的货运订单或者共享证书的分红中获得收益。区块链2.0技术跳过了交易和“价值交换中担任金钱和信息仲裁的中介机构”。它们被用来使人们远离全球化经济,使隐私得到保护,使人们“将掌握的信息兑换成货币”,并且有能力保证知识产权的所有者得到收益。第二代区块链技术使存储个人的“永久数字ID和形象”成为可能,并且对“潜在的社会财富分配”不平等提供解决方案 12  。2016年1月20日,中国人民银行数字货币研讨会宣布对数字货币研究取得阶段性成果。会议肯定了数字货币在降低传统货币发行等方面的价值,并表示央行在探索发行数字货币。中国人民银行数字货币研讨会的表达大大增强了数字货币行业信心。这是继2013年12月5日央行五部委发布关于防范比特币风险的通知之后,第一次对数字货币表示明确的态度。 13 2016年12月20日,数字货币联盟——中国FinTech数字货币联盟及FinTech研究院正式筹建 14  。如今,比特币仍是数字货币的绝对主流,数字货币呈现了百花齐放的状态,常见的有bitcoin、litecoin、dogecoin、dashcoin,除了货币的应用之外,还有各种衍生应用,如以太坊Ethereum、Asch等底层应用开发平台以及NXT,SIA,比特股,MaidSafe,Ripple等行业应用 15  。公有区块链公有区块链(Public Block Chains)是指:世界上任何个体或者团体都可以发送交易,且交易能够获得该区块链的有效确认,任何人都可以参与其共识过程。公有区块链是最早的区块链,也是应用最广泛的区块链,各大bitcoins系列的虚拟数字货币均基于公有区块链,世界上有且仅有一条该币种对应的区块链 16  。联合(行业)区块链行业区块链(C

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值