Skip to content

add libsodium recipe #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2015
Merged

add libsodium recipe #385

merged 1 commit into from
Jun 30, 2015

Conversation

mathewvermeer
Copy link
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
Copy link

ghost commented Jun 29, 2015

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

@tito
Copy link
Member

tito commented Jun 30, 2015

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