Hi everyone AsymmetricCryptography is an extension which you can use to add end-to-end encryption(asymmetric encryption) in your app.It uses asymmetric encryption which ensures that your data is safe.
Latest Version: 3.1 Last Updated:2021-06-30T12:32:00Z
2.Blocks
3.Documentation
A quick and short documentation for AsymmetricCryptography :
Generates keys of provided length and raises event 'KeysGenerated' with success and response values.
Note: (i) Big key size will consume more ram.It behaves normal upto 4096.
(ii) Key length should be at least 8 times of string length.
For Example :
A key of length 1024 can encrypt a string of length 128.
Returns private key in string format
Returns public key in string format
Tries to encrypt given string with provided public key and returns encrypted text
Tries to decrypt given string with provided private key and returns decrypted text
It depends on your needs.If you want to decrypt and read data sent by a user then you can do that using the extension.A perfect example can be chat system where A's message can only be read by B and B's message can only be read by A because public keys are exchanged between them.So A can decrypt B's messages and B can decrypt A's messages.
I should have been more explicit, by the âother endâ I meant somewhere that wasnât another app with the same extension. Can decrypting only take place using these blocks ?
I get this error in label2 using your example aia, when applying private and public keys in the textboxes. I used 123 and 456 (also tried with words)
java.lang.NullPointerException: Attempt to invoke virtual method 'java.security.PublicKey java.security.KeyFactory.generatePublic(java.security.spec.KeySpec)' on a null object reference
This is probably because cipher and keyfactory have not been initialized because GenerateKeys has not been called.
You can call it a bug of single line.
Can somebody explain to me how to use this in App Inventor? I donât know much about asymmetric encryption. I always thought you share the public key and keep the private key secret. Another thing that confuses me is the keyLength. Does that mean I have to generate a key pair each time I want to encrypt something?
I mean if my text length is different each time, do I really have to generate a new key? What about different devices, how can I encrypt something on my phone and decrypt on my friendâs phone? Sorry for the questions, Iâm evaluating if I can use the extension for one of my projects
I think no.You can generate a key of big length like 10240 so it can encrypt/decrypt upto 1280 bytes.But big key length can be a problem in old devices which are running below Android 5.0
First of all generate a key pair of desired length.
Now if you have a hackproof database (Firebase or MySql) then I will recommend to store there.Otherwise store keys in Obfuscated text at build time.
java.lang.NullPointerException: Attempt to invoke virtual method 'java.security.PublicKey java.security.KeyFactory.generatePublic(java.security.spec.KeySpec)' on a null object reference
which seems to indicate that there is nothing available to generate an encrypted string.