GithubHelp home page GithubHelp logo

kant / max-adversarial-cryptography Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibm/max-adversarial-cryptography

0.0 1.0 0.0 21 KB

Protect communications with adversarial neural cryptography.

Home Page: https://developer.ibm.com/code/exchanges/models/

License: Apache License 2.0

Shell 100.00%

max-adversarial-cryptography's Introduction

IBM Code Model Asset Exchange: Adversarial Cryptography Experiment

This repository contains code to run an Adversarial-Crypto experiment on IBM Watson Machine Learning. This experiment performs adversarial training to learn trivial encryption functions. The experiment is based on the 2016 paper "Learning to Protect Communications with Adversarial Neural Cryptography" by Abadi and Andersen.

This experiment creates and trains three neural networks, termed Alice, Bob, and Eve. Alice takes inputs in_m (message), in_k (key) and outputs the ciphertext as a string. Bob takes inputs in_k, ciphertext and tries to reconstruct the message. Eve is an adversarial network that takes the ciphertext as its input and also tries to reconstruct the message. The main function attempts to train these networks and then evaluates them, all on random plaintext and key values.

This repository was developed as part of the IBM Code Model Asset Exchange

Quickstart

Prerequisites

  • This experiment requires a provisioned instance of the IBM Watson Machine Learning service.

Set Up an IBM Cloud Object Storage (COS) account

  • Create an IBM Cloud Object Storage account if you don't have one (https://www.ibm.com/cloud/storage)
  • Create credentials for either reading and writing or just reading
    • From the bluemix console page (https://console.bluemix.net/dashboard/apps/), choose Cloud Object Storage
    • On the left side, click the service credentials
    • Click on the new credentials button to create new credentials
    • In the 'Add New Credentials' popup, use this parameter {"HMAC":true} in the Add Inline Configuration...`
    • When you create the credentials, copy the access_key_id and secret_access_key values.
    • Make a note of the endpoint url
      • On the left side of the window, click on Endpoint
      • Copy the relevant public or private endpoint. [I choose the us-geo private endpoint].
  • In addition setup your AWS S3 command line which can be used to create buckets and/or add files to COS.
    • Export AWS_ACCESS_KEY_ID with your COS access_key_id and AWS_SECRET_ACCESS_KEY with your COS secret_access_key

Set Up IBM CLI & ML CLI

  • Install IBM Cloud CLI
    • Log in using bx login or bx login --sso if within IBM
  • Install ML CLI Plugin
    • After install, check if there is any plugins that need update
      • bx plugin update
    • Make sure to set up the various environment variables correctly:
      • ML_INSTANCE, ML_USERNAME, ML_PASSWORD, ML_ENV

Running the experiment

The run.sh utility script will deploy the experiment to WML and execute the experiment as a training-run

run.sh

Try this experiment in Fabric for Deep Learning

If you want to run this experiment using Fabric for Deep Learning (FFDL), You can simply clone the FfDL repository and follow the instructions over here to convert your training-runs.yml into FfDL's specification.

Licenses

Component License Link
This repository Apache 2.0 LICENSE
Model Code (3rd party) Apache 2.0 TensorFlow Models

References

max-adversarial-cryptography's People

Contributors

animeshsingh avatar djalova avatar frreiss avatar lresende avatar tomcli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.