Skip to content

Commit b2b549d

Browse files
authored
Merge pull request #12 from simplefin/better-safe
Update safe image
2 parents a4fb204 + 92e3249 commit b2b549d

5 files changed

Lines changed: 3 additions & 73 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ _site
22
.sass-cache
33
node_modules
44
.DS_Store
5+
.jekyll-cache/

README.md

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,3 @@ Remake table of contents:
44

55
# npm install doctoc
66
doctoc protocol.md
7-
8-
#### Python Reference
9-
10-
Here's an example of using the [`ecdsa`](https://pypi.python.org/pypi/ecdsa/) and [`pyjwt`](https://github.com/jpadilla/pyjwt) Python libraries to generate a setup token:
11-
12-
{% highlight bash %}
13-
pip install pyjwt ecdsa
14-
{% endhighlight %}
15-
16-
{% highlight python %}
17-
# on the SimpleFIN Server
18-
from uuid import uuid4
19-
from ecdsa import SigningKey
20-
21-
22-
key_database = {}
23-
24-
def generateSetupToken(internal_user_id):
25-
token_id = str(uuid.uuid4())
26-
private_key = SigningKey.generate()
27-
public_key = private_key.get_verifying_key()
28-
29-
# save for verifying later
30-
key_database[token_id] = public_key.to_string().encode('hex')
31-
32-
return json.dumps({
33-
'id': token_id,
34-
'secret': private_key.to_string().encode('hex'),
35-
'url': 'https://simplefin.example.com',
36-
}).encode('base64')
37-
38-
{% endhighlight %}
39-
40-
{% highlight python %}
41-
# on a Consumer
42-
private_pem = SigningKey.from_string('044be9c05ac12793a1deeb1c983539f3db0d3fb853bdc83b'.decode('hex')).to_pem()
43-
44-
# ...
45-
# back on the server
46-
assert public_key.verify(signature, "message")
47-
{% endhighlight %}
48-
49-
50-
51-
###
52-
53-
from ecdsa import SigningKey
54-
import jwt
55-
secret = "044be9c05ac12793a1deeb1c983539f3db0d3fb853bdc83b"
56-
data = {
57-
"id": "6e71a22a6ce9458b9897242423734d9c",
58-
"iat": 1435724162,
59-
"exp": 1435724222
60-
}
61-
key = SigningKey.from_string(secret.decode('hex')).to_pem()
62-
jwt.encode(data, key, algorithm='ES256')
63-
64-
65-
66-
67-
68-
from Crypto.PublicKey import RSA
69-
>>> RSAkey = RSA.generate(1024)
70-
private = RSA.generate(1024)
71-
>>> public = private.publickey()
72-
>>> private.exportKey()
73-
'-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQDo1M0P3nryaF8ZITv8vCFVnjUJ1mnIsrqXZRTzjin69xepr3cz\nKicG3EYSUqMODQAsvMj0tGMo+ElGOVOkPFLVVBHd8izgA/E1RqUzbUDMj4WnhlhA\nQq7tNaViOXNaZ7krJZHabZKxfYvLAQtm4tr+m5NtXPBaWvjwhd5M9xvktwIDAQAB\nAoGBANVsS1Rikbymo5V7e2teYAgFb4THAEyyWIvyYlQnWp/r48rtRoyl9QQ64hhl\nm4WDsUdQ/bwhpkul3DT804jWqu2V71p68rQP7h5D6ldCBUr5nQc9o/uEyy4YCgxD\n/ZxNiY5Bb/lMP9nhb2NbG4184mhUMHu+06wWX6RrXQtMtjYhAkEA8DioToMZIy3s\nhPohri3CAgByV2Jxf7JPqVZ93JjlSlBz+aybSv1mOJUPRFpkMk2xiPmHtEn16hYr\nesVK11tcjwJBAPgf4QYAw9dV+DuVqdwz+kmTjnlkr0Q7fjaGfl60DWmuLWmxiRhe\nMYQ2+8iyPDmxcPFTGSpGqyvyJDjQ/wOlWVkCQQCRIuotZW/OnXSFc0reHa9V3kc3\nHLdOW8FdonAw0//Uwn8PnoXE7QzRqt2qgqJ+8goNpBWli/oUEIj8iC8LpptpAkBV\nFFlMfaaph8j+ZWtBHnGMGRSZe3S9qMi2WZerUYHn4tmfjEi+Gk5QT6o2Pyd3gOiB\nV0Uhwemfv/+7m65VybTBAkEA5H59kG+B9HHD5hJtksAtMh8dxk/MI8G0csduU0vu\n7K5ejL522XsHurVrWdqnk6KvjlRXqB4FsMWLE6RBgBNV0A==\n-----END RSA PRIVATE KEY-----'
74-
>>> public.exportKey()
75-
'-----BEGIN PUBLIC KEY-----\

img/safe.png

-497 KB
Loading

img/safe.small.png

-188 KB
Binary file not shown.

index.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ layout: default
44

55
SimpleFIN (also SFIN) stands for Simple Financial Interchange and makes read-only financial interchange simple. It's like RSS for financial information.
66

7-
# Why give them the combination to your safe...
7+
<span style="font-size: 2rem;">Why give out your <span style="font-weight: bold; font-style: italic;">key</span> when they only need a <span style="font-weight: bold; font-style: italic;">window?</span></span>
88

99
<center>
10-
<img src="/img/safe.small.png" style="width: 50%;">
10+
<img src="/img/safe.png">
1111
</center>
1212

13-
# ...when they only need to look through a window?
14-
1513
SimpleFIN is like a window on a safe: it lets people look at, but not touch your financial information. And you control who can look through the window!
1614

1715
You should use SimpleFIN because:

0 commit comments

Comments
 (0)