How to build AES Crypt for Android shared Library ( JNI )
How to build AES Crypt for Android shared Library ( JNI )
Hi,
now i am using MAC OSX MAVERICK and I'm trying to create a shared library within an Android project in eclipse to use it via JNI calls, but
when I execute the build command (ndk-build) I receive the following error:
Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Compile thumb : AESCrypt <= libAESCrypt.c
Compile thumb : AESCrypt <= aes.c
Compile thumb : AESCrypt <= aescrypt.c
jni/aescrypt.c:30:34: fatal error: iconv.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/AESCrypt/aescrypt.o] Error 1
I upload Eclipse ADT project.
Can someone help me?
Greetings
now i am using MAC OSX MAVERICK and I'm trying to create a shared library within an Android project in eclipse to use it via JNI calls, but
when I execute the build command (ndk-build) I receive the following error:
Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Compile thumb : AESCrypt <= libAESCrypt.c
Compile thumb : AESCrypt <= aes.c
Compile thumb : AESCrypt <= aescrypt.c
jni/aescrypt.c:30:34: fatal error: iconv.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/AESCrypt/aescrypt.o] Error 1
I upload Eclipse ADT project.
Can someone help me?
Greetings
- Attachments
-
- test.aes.zip
- (1.25 MiB) Downloaded 967 times
- paulej
- Posts: 593
- Joined: Sun Aug 23, 2009 7:32 pm
- Location: Research Triangle Park, NC, USA
- Contact:
Re: How to build AES Crypt for Android shared Library ( JNI
It sounds like iconv() is not supported on Android. Just get rid of that and change the code to convert the input format for passwords into UTF16-LE.
Re: How to build AES Crypt for Android shared Library ( JNI
Thanks for the reply.
But I do not know how to change the source code to convert the input format for passwords into UTF16-LE.
I attach source of eclipse project of AESCrypt, can you help me ?
Many, many thanks....
Greeting
But I do not know how to change the source code to convert the input format for passwords into UTF16-LE.
I attach source of eclipse project of AESCrypt, can you help me ?
Many, many thanks....
Greeting
- paulej
- Posts: 593
- Joined: Sun Aug 23, 2009 7:32 pm
- Location: Research Triangle Park, NC, USA
- Contact:
Re: How to build AES Crypt for Android shared Library ( JNI
What format is the text in when enteref into Android? It might already be UTF-16LE, in which case no conservation is even needed.
If no conversion is needed, you can just remove the call to iconv(). If conversion is needed, you just need to know the input character encoding used. The conversion process is surely you something you can handle if you're building this kind of app.
BTW, are you aware that there is already a port of AES Crypt to android? Source is not available, other than the same source you are using. Nonetheless, there is already one tool.
If no conversion is needed, you can just remove the call to iconv(). If conversion is needed, you just need to know the input character encoding used. The conversion process is surely you something you can handle if you're building this kind of app.
BTW, are you aware that there is already a port of AES Crypt to android? Source is not available, other than the same source you are using. Nonetheless, there is already one tool.
Re: How to build AES Crypt for Android shared Library ( JNI
The text that I enter in the Android consists of ASCII characters without any special coding.
I try to remove the function iconv() let's see what happens .....
Could you tell me where I ported to Android AESCrypt.
Many thanks
I try to remove the function iconv() let's see what happens .....
Could you tell me where I ported to Android AESCrypt.
Many thanks
- paulej
- Posts: 593
- Joined: Sun Aug 23, 2009 7:32 pm
- Location: Research Triangle Park, NC, USA
- Contact:
Re: How to build AES Crypt for Android shared Library ( JNI
I'm not referring to the characters you enter. Rather, I'm referring to the character encoding used by Android. Based on this page, UTF-8 is the default encoding: http://developer.android.com/reference/ ... arset.html.
AES Crypt passwords need to be in UTF-16LE format. So, it might be possible to use this method to perform the conversion. Our, it might be possible to just change the default encoding to be UTF-16LE. No BOM is present in password strings.
You might also be able to call this function if the password is in a strong class: http://download.oracle.com/javase/6/doc ... .String%29
AES Crypt passwords need to be in UTF-16LE format. So, it might be possible to use this method to perform the conversion. Our, it might be possible to just change the default encoding to be UTF-16LE. No BOM is present in password strings.
You might also be able to call this function if the password is in a strong class: http://download.oracle.com/javase/6/doc ... .String%29
Re: How to build AES Crypt for Android shared Library ( JNI
Hi,
thanks for your time and patience.
I modified the C sources eliminating the conversion to UTF-16LE, I modified the java source eliminating the conversion to UTF-16LE, I imported everything into an Android project with JNI, and everything works properly.
I still want to properly test the code making sure that everything works properly
Thanks again, greetings
thanks for your time and patience.
I modified the C sources eliminating the conversion to UTF-16LE, I modified the java source eliminating the conversion to UTF-16LE, I imported everything into an Android project with JNI, and everything works properly.
I still want to properly test the code making sure that everything works properly
Thanks again, greetings
-
- Posts: 1
- Joined: Wed Nov 03, 2021 4:58 pm
Re: How to build AES Crypt for Android shared Library ( JNI )
Simple API to perform AES encryption on Android with no dependancies. This is the Android counterpart to the AESCrypt library Ruby and AESCrypt-ObjC created by Gurpartap Singh. It used the same weak :'( security defaults i.e Blank IV noted below.
For compatiblity with AESCrypt, AESCrypt-Android has the same defaults namely:
256-bit AES key
CBC mode
PKCS7Padding
Blank/Empty IV (default)*
*Using CBC with the default blank IV is vulnerable. This has been left in for compatibility with AESCrypt implementations. See Adv method for providing your own IV. If you don't need to be compatable with AESCrypt then look at java-aes-crypto it's API is just as simple and generates more secure keys.
For compatiblity with AESCrypt, AESCrypt-Android has the same defaults namely:
256-bit AES key
CBC mode
PKCS7Padding
Blank/Empty IV (default)*
*Using CBC with the default blank IV is vulnerable. This has been left in for compatibility with AESCrypt implementations. See Adv method for providing your own IV. If you don't need to be compatable with AESCrypt then look at java-aes-crypto it's API is just as simple and generates more secure keys.
- paulej
- Posts: 593
- Joined: Sun Aug 23, 2009 7:32 pm
- Location: Research Triangle Park, NC, USA
- Contact:
Re: How to build AES Crypt for Android shared Library ( JNI )
You are referring to a completely different program called "aescrypt" than AES Crypt. The latter (which is what this forum is about) definitely does not leave the IV empty. It is populated with random values.sstevemmitchell wrote: ↑Wed Nov 03, 2021 5:03 pm Simple API to perform AES encryption on Android with no dependancies. This is the Android counterpart to the AESCrypt library Ruby and AESCrypt-ObjC created by Gurpartap Singh. It used the same weak :'( security defaults i.e Blank IV noted below.
For compatiblity with AESCrypt, AESCrypt-Android has the same defaults namely:
256-bit AES key
CBC mode
PKCS7Padding
Blank/Empty IV (default)*
*Using CBC with the default blank IV is vulnerable. This has been left in for compatibility with AESCrypt implementations. See Adv method for providing your own IV. If you don't need to be compatable with AESCrypt then look at java-aes-crypto it's API is just as simple and generates more secure keys.
- paulej
- Posts: 593
- Joined: Sun Aug 23, 2009 7:32 pm
- Location: Research Triangle Park, NC, USA
- Contact:
Re: How to build AES Crypt for Android shared Library ( JNI )
Those libraries exist on Mac. See https://stackoverflow.com/questions/577 ... on-mac-osx