AES Encryption in Thunkable


#1

Is there a way to encrypt strings wit AES-128 bit and AES-256 bit?


Hash and Encryption support
#2

There is an extension for this HERE, however, you have to pay.

The @thunkable team are currently working on iOS and other new components so this may not be high on their priority at the moment.


#3

Is this extension also compatible with Thunkable or only with App Inventor?


#4

I can’t see why it wouldn’t work. However, I cannot say that it does.


#5

You can develope a website where there is a file .php (index.php if you want) and add the function mcrypt and declare to encrypt with AES
To get redults, use $_GET['encrypt'] result and put it in encript string place


#6

Could you give me an axample how to do this? I am not into php.


#7

Sure

Take a look to this url: http://server.sosgram.ga/android/md5.php?mode=passwd&entry=Thunkable
You can see this parts: Subdomain (server), Domain (sosgram.ga), Directory (android), File (md5.php) and PHP GET Requests (mode & entry)

This works as an interactive content, the mode declares what do you want (in this case a password) and the entry what do you want to encrypt (in this case, Thunkable) and you get a plain text encrypted as MD5.
The content of the file:

<?php
if ($_GET['mode'] == 'passwd') {
    $url = $_GET['entry'];
    print(md5($url));
}

else { print('Bad Request');}
?>

It’s quite easy to understand it: first you verify that the URL contains the paremeter mode (with $_GET['mode']), then you verify that the mode is set to passwd, or whatever you want. Aftert that, you declare a variable $url (for example) that gets the content of the entry parameter url (with $_GET['entry']). And finally you print the request entry encrypted with MD5.


You can do the same but with mcrypt mode to AES. To do this, create a folder, and upload this documents: AES Encryption and Decryption with PHP

Upload them to your site or use mine. If you upload to your site, I recommend you to rename index2.php to index.php, so it will be launched automatically.


To encrypt with this files: http://barreeeiroo.ga/es/php/aes/index2.php?mode=aes&string=test&key=test&size=128&do=encrypt
Introduce your domain, path and file, and add: ?mode=aes&string=what do you want to encrypt&key=the key you want to use to encrypt&size=choose between 128,192 or 256&do=encrypt

To decrypt with this files: http://barreeeiroo.ga/es/php/aes/index2.php?mode=aes&string=oZkueCPZ34YN9TySUzWp2g==&key=test&size=128&do=decrypt
Introduce your domain, path and file, and add: ?mode=aes&string=the encrypted string&key=the key you used to encrypt it&size=choose between 128,192 or 256 (choose what you used to encrypt)&do=decrypt



Hope it helps :wink:


Md5 hashing in Thunkable!
Creating Class In Firebase
Changed Firebase Token
Frequently Asked Questions (FAQ)
#8

Thank you very much! It works for me now!
But could you give a link to the two files, I cant get them from your website.


#9

Glad to here that!

If you need anything about encryption or similar or you need PHP help talk to me


#10

For this operation the users needs to have an active internet connection. Is it possible to save the two files locally so that the phone does not have to have an internet connection to encrypt files?


#11

Mmm, yes, but I think that the files must be downloaded at least one time

Let me try some things and I will share an AIA file for it

EDIT: I can’t do that, I have no time sorry. But you can do it uploading the files to assets folder in Thunkable and calling them to encrypt files (the Web Component url will be: file:///mnt/sdcard/AppInventor/assets/index.php)


#12

It does not work for me. It always says: “Error 1101: Unable to get a response with the specified URL”


#13

Mmm, for me all links are working

Can you share your blocks?


#14

I think you can do it.Upload requered html files to your app assets and call it from app

Check this
http://puravidaapps.com/pie.php


#15

No, you can’t
Because I’ve used a PHP File, and only web servers can execute it

I mean, PHP files are a special type of files that have became very popular, so Apache, NGinx and other Web Servers decided to add it and read them, so they installed binary files of PHP in their source code, and nowadays all webs use them. But, Android OS doesn’t process it, they only process HTML because the HTML language is based on labels, more concretly in XML, so it’s very easy to process them, because Android Design is in XML (as you can see in AndroidStudio, you will have to lear XML if you want to make your designs better).

So, in conclusion, if you want to execute and process PHP Files, you will have to install PHP in your OS
You can verify it very simple: create an HTML file with this code: https://gist.github.com/barreeeiroo/14e85728abe0ceed4dbe32ec1449e820, and try to open it with a normal browser without uploading it to a server
You will see that the file doesnt displays correclty


#16

I’ve Used It Before. It Usually Works With Thunkable. Sometimes It Stops Working Though And Crashes.


#17

In an update a few months ago, the Thunkable team fixed the issues with the Pura Vida / Taifun extensions. Can you try it again and let me know if it works?


#18

I use a lot of taifuns extensions in my projects and have no problems with them :slight_smile:


#19

I Just Tried It’s Working For Me!