Skip to content

add libsodium recipe#385

Merged
tito merged 1 commit into
kivy:masterfrom
mathewvermeer:master
Jun 30, 2015
Merged

add libsodium recipe#385
tito merged 1 commit into
kivy:masterfrom
mathewvermeer:master

Conversation

@mathewvermeer

Copy link
Copy Markdown
Contributor

This recipe was tested with the following app:

__version__ = "1.0.0"

import kivy
import libnacl
import time
import sys
from libnacl import public

kivy.require('1.9.0')

from kivy.app import App
from kivy.uix.label import Label
from kivy.logger import Logger

class MyApp(App):

    def build(self):
        # Asymmetric encryption example from libnacl/libsodium site
        msg = b'You\'ve got two empty halves of coconut and you\'re bangin\' \'em together.'

        bob = libnacl.public.SecretKey()
        alice = libnacl.public.SecretKey()

        bob_box = libnacl.public.Box(bob.sk, alice.pk)
        alice_box = libnacl.public.Box(alice.sk, bob.pk)

        bob_ctxt = bob_box.encrypt(msg)
        bclear = alice_box.decrypt(bob_ctxt)
        alice_ctxt = alice_box.encrypt(msg)
        aclear = alice_box.decrypt(alice_ctxt)
        return Label(text=aclear)

if __name__ == '__main__':
    MyApp().run()

If libsodium compiles and is copied correctly, the encryption code completes without error and the created label will be shown on the screen. The dependencies in the buildozer.spec file are kivy, libnacl, and libsodium.

@ghost

ghost commented Jun 29, 2015

Copy link
Copy Markdown

@tito Can you have a look at this and comment if you want to see something changed? Thanks in advance.

@tito

tito commented Jun 30, 2015

Copy link
Copy Markdown
Member

everything is ok, thanks for mentioning it :)

tito added a commit that referenced this pull request Jun 30, 2015
@tito tito merged commit 8395e8a into kivy:master Jun 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants