Solved PyCrypto or other ways for AES encryption for KODI on Android
#1
I need some way for AES encryption on Android. For PC i used this script: https://github.com/eirki/script.module.pycryptodome , and just loaded it like in python
cpp:
from Crypto.Util import Padding
from Crypto.Cipher import AES
but on android i get error, i guess that is because it have some C binaries. I found few threads about this, but they are from 2-3 years ago and in most threads they in the end used another app to get encryption.
Is there a way to use pycrypto or pycryptodome or some other library in Kodi addon for Android?
Reply
#2
pycryptodome is a python module which includes some C code and that makes the module platform and architecture dependent. The one you use is only compatible with windows (don't know if 32 or 64 bit)

What kodi version are you using on android?
v18 includes pycryptodome on all platforms.
Reply
#3
Pycryptodome should be available in Leia builds.
Reply
#4
V17.6 is on Android. Is there some way i could download latest v18 for Android? I installed kodi-android-installer, and some version of leia, but the addon still don't work, do i need to change something in how to import library or something else? this is from addon.xml
xml:
<import addon="script.module.pycryptodome" version="3.4.1"/>
Reply
#5
Try a pure python implementation. 

I also want to use Pycryptodome under Leia (for SHA3_224), but under Krypton I have to use a pure python implementation.

A quick google gives me for AES:
https://github.com/ricmoo/pyaes
https://github.com/bozhu/AES-Python
https://gist.github.com/jeetsukumaran/1291836
- ...

No experience with these myself...

Test them out by looking if you get the same results from the pure python implemention, compared to the Pycryptodome implementation.

It will be much slower, but it should work.
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#6
see https://github.com/asciidisco/plugin.vid...don.xml#L6 and https://github.com/asciidisco/plugin.vid...py#L16-L21
Reply
#7
I tried using v18, but i have different error on android and on windows. On windows kodi create encrypted url but it fail to play, i checked the url and the url is right, this is from log:
cpp:
16:49:18.263 T:2188  NOTICE: VideoPlayer::OpenFile: https://.........
16:49:18.283 T:1588  NOTICE: Creating InputStream
16:49:18.399 T:1588  NOTICE: Creating Demuxer
16:49:18.440 T:1588   ERROR: CVideoPlayer::OpenDemuxStream - Error creating demuxer
16:49:18.440 T:1588  NOTICE: CVideoPlayer::OnExit()
16:49:19.851 T:2188 WARNING: CGUIWindowManager - CGUIWindowManager::HandleAction - ignoring action 107, because topmost modal dialog closing animation is running
16:49:48.643 T:4568 WARNING: Previous line repeats 10 times.

and this is how i add videos:
cpp:
def add_ch(name,video_play_url, imgurl):
    url = build_url({'mode' :'play', 'playlink' : video_play_url})
    li = xbmcgui.ListItem(name, iconImage=imgurl)
    li.setProperty('IsPlayable' , 'true')
    li.setInfo('video',' ')
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)


EDIT: After changing it to run over http it looks like it works on both windows and android
Reply

Logout Mark Read Team Forum Stats Members Help
PyCrypto or other ways for AES encryption for KODI on Android0