Skip to content

Instantly share code, notes, and snippets.

View iachievedit's full-sized avatar
🦁
Rey de la selva

iAchieved.it iachievedit

🦁
Rey de la selva
View GitHub Profile

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

curl -v http://localhost:7335/plain http://localhost:7335/switch http://localhost:7335/plain
* About to connect() to localhost port 7335 (#0)
* Trying 127.0.0.1... connected
> GET /plain HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:7335
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sat, 16 Aug 2014 18:13:44 GMT
@iachievedit
iachievedit / gist:6870ef58c232577cdea0
Created August 16, 2014 18:15
Switching protocols on Twisted
from twisted.web.server import Site
from twisted.web.http import HTTPChannel
from twisted.web.resource import Resource
from twisted.internet import reactor
class MyServer(Resource):
isLeaf = True
def render_GET(self, request):
if request.uri == "/switch":