aes

Android slow AES decryption

别说谁变了你拦得住时间么 提交于 2019-11-29 12:09:43
Ref: Android encryption/decryption issue (AES) I am building an android app which requires aes decryption of a really large package (~50Mb) and it is really slow when implemented in android's inbuilt aes decryption mechanism (around 5 minutes). Based on the above posts in SO, I attempted to use ndk and tried to download native libraries (openssl) to use for this app. However, openssl for android has a really large number of files and I do not know which ones to use to create the .so file. I am quite inexperienced with the use of ndk and native code in android apps and would find any

Java KeyStore setEntry() using an AES SecretKey

∥☆過路亽.° 提交于 2019-11-29 12:06:46
I'm currently working on an key-handling class in Java, specifically using a KeyStore. I'm trying to generate a SecretKey with an AES instance, then place it inside of the KeyStore using the setEntry() method. I've included the relevant sections of my code: // The KS Object private KeyStore keyStore; private KeyStore.SecretKeyEntry secretKeyEntry; private KeyStore.ProtectionParameter protectionParameter; private KeyGenerator keyGenerator; private SecretKey secretKey, newSecretKey; keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyGenerator = KeyGenerator.getInstance("AES");

Encrypting Crypt field using Classic ASP for SagePay Form Integration

丶灬走出姿态 提交于 2019-11-29 12:04:50
I always get the same error 3045: The Currency field is missing, when posting this form: <form name="frmPay" action="https://test.sagepay.com/gateway/service/vspform-register.vsp" method="POST"> <input type="text" name="VPSProtocol" value="3.00" /> <input type="text" name="TxType" value="PAYMENT" /> <input type="text" name="Vendor" value="myvendor" /> Crypt:<textarea rows="10" cols="200" name="Crypt"><%=Crypt%></textarea> <input type="submit" value="Send" /> </form> I think the error is in the encryption Could someone send encryption routine for classic ASP? Lankymart UPDATE (19-Nov-2014): A

Is it possible to use AES128 with GCM mode on iOS?

时光怂恿深爱的人放手 提交于 2019-11-29 11:41:06
So my question for you stackoverflow geniuses is: if there a way (native, library, framework, whatever..) to encrypt data with AES (preferably 128 but could be 256 too) using a strong Authenticated encryption algorithm , let's say GCM mode ? Question is short, I have done some research and I only found one library that seems to support it ( RNCryptor ) but it also seems to use password to crypt instead of keys (like you provide a password and the library made the key) and I don't like that a lot, I prefer to manage my keys myself . I also look at CommonCryptor.h and I found that line, which

OpenSSL AES_cfb128_encrypt C++

我们两清 提交于 2019-11-29 11:23:14
I tried to implement a "very" simple encryption/decryption example. I need it for a project where I would like to encrypt some user information. I can't encrypt the whole database but only some fields in a table. The database and most of the rest of the project works, except the encryption: Here is a simplified version of it: #include <openssl/aes.h> #include <openssl/evp.h> #include <iostream> #include <string.h> using namespace std; int main() { /* ckey and ivec are the two 128-bits keys necessary to en- and recrypt your data. Note that ckey can be 192 or 256 bits as well */ unsigned char

Convert Encrypt code in java to Ruby

*爱你&永不变心* 提交于 2019-11-29 10:25:12
问题 I have been trying to convert a code for encrypt in java to ruby, but I am not able to do it completely. I getting different values. passphrase = passphrase + STATIC_KEY; byte[] key = passphrase.getBytes("UTF-8"); MessageDigest sha = MessageDigest.getInstance("SHA-1"); key = sha.digest(key); key = Arrays.copyOf(key, 16); SecretKey secretKey = new SecretKeySpec(key, "AES"); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); IvParameterSpec initialisationVector = new IvParameterSpec(

Create random 128 bit AES Encryption key in iOS

跟風遠走 提交于 2019-11-29 10:14:56
问题 I want to create random AES Encryption key (128 bit) in ios. I have searched in SO but I cannot find a good answer. Please give me some advice. thanks in advance. UPDATE: I have used BBAES lib. I used the below code to generate the encryption key but when I convert from NSData to NSString, it shows NULL -(NSData*)randomDataWithLength{ NSData* salt = [BBAES randomDataWithLength:BBAESSaltDefaultLength]; NSData *key = [BBAES keyBySaltingPassword:@"password" salt:salt keySize:BBAESKeySize128

AES/CBC/PKCS5Padding encrypt in java decrypt in ruby

。_饼干妹妹 提交于 2019-11-29 10:11:08
问题 I am trying to encrypt data in java and decrypt data in ruby. I found almost same asks, but my case is little bit different. Encrypt in Ruby and Decrypt in Java - Why is it not working? AES/CBC encrypt in Java, decrypt in Ruby My code is ... Encrypt in java import java.util.HashMap; import java.util.Map; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import net.sf.json.JSONObject; import org.apache

iOS encryption AES128/CBC/nopadding why is not working?

帅比萌擦擦* 提交于 2019-11-29 10:03:42
问题 I have an app that needs to encode some data using AES/CBC/no padding. The app is ported also on android. There the encoding is done like this: byte[] encodedKey = getKey(); SecretKeySpec skeySpec = new SecretKeySpec(encodedKey, "AES"); AlgorithmParameterSpec paramSpec = new IvParameterSpec(initializationVector); Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec, paramSpec); int blockSize = cipher.getBlockSize(); int diffSize = decrypted.length

Client-side encryption over HTTP with Diffie-Hellman Key Exchange and AES

浪子不回头ぞ 提交于 2019-11-29 07:56:37
问题 After watching a YouTube video on the Diffie-Hellman Key Exchange, I wanted to try an implementation in JavaScript (Atwood's law). I sketched up an cipher on Node.js with the following rules: Step 1: Client and server agree on a shared key: Client & server start with a 512bit prime public key pK Client generates a 512bit prime private key kC and sends powMod(3, kC, pK) Server generates a 512bit prime private key kS and sends powMod(3, kS, pK) Client & Server use powMod(response, privatekey,