GithubHelp home page GithubHelp logo

awslambda-pycrypto's Introduction

awslambda-pycrypto

Python Cryptography Toolkit (pycrypto) compiled and packaged for AWS Lambda. Because that is a pain to do.

Setup

Simply download and include the Crypto folder in your project, zip and upload it to Lambda.

Lambda Example:

Directory structure:

* myproject
  - Crypto/
  - lambda_handler.py

lambda_handler.py:

from __future__ import print_function

from Crypto.Hash import SHA256


def lambda_handler(event, context):
    hash = SHA256.new()
    hash.update('message')
    digest = hash.digest()
    print(len(digest))
    print(repr(digest))
    return

Log output:

START RequestId: 17e0f272-9b91-11e6-bf2d-f756ae83795f Version: $LATEST
32
'\xabS\n\x13\xe4Y\x14\x98+y\xf9\xb7\xe3\xfb\xa9\x94\xcf\xd1\xf3\xfb"\xf7\x1c\xea\x1a\xfb\xf0+F\x0cm\x1d'
END RequestId: 17e0f272-9b91-11e6-bf2d-f756ae83795f
REPORT RequestId: 17e0f272-9b91-11e6-bf2d-f756ae83795f	Duration: 0.28 ms	Billed Duration: 100 ms 	Memory Size: 128 MB	Max Memory Used: 14 MB	

Disclaimer

Use at your own risk. I compiled this for usage in a personal project where it worked fine.

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.