aes

AES Encryption Blackberry

旧时模样 提交于 2019-12-11 18:57:52
问题 I am basically and android Developer and as per project requirement i need to develop in blackberry. My task is AES encryption of simple text like HELLO. What i did: I used this LINK but as a result i am getting java.lang error in simulator What i want: Kindly Suggest me a way to avoid this error. and sample for AES encryption working sample in Blackberry; My approach is following: String mystr = "HELLO"; try { String str = AES.AESEncryption(mystr.getBytes()); System.out.print(str); } catch

decrpyt .Net Encrypted string in iOS

穿精又带淫゛_ 提交于 2019-12-11 18:49:54
问题 I made some AES encryption in c# and works like a charm. Code here: public string EncryptStringAES(string plainText, string sharedSecret) { if (string.IsNullOrEmpty(plainText)) throw new ArgumentNullException("plainText"); if (string.IsNullOrEmpty(sharedSecret)) throw new ArgumentNullException("sharedSecret"); string outStr = null; // Encrypted string to return RijndaelManaged aesAlg = null; // RijndaelManaged object used to encrypt the data. try { _pkey = sharedSecret; // generate the key

AES Encryption / Decryption with Java 1.5 and ActionScript as3crypto

怎甘沉沦 提交于 2019-12-11 18:08:09
问题 On my website I am using AES 128bit encryption/decryption of a string. I encrypt a string in Java and I want to decrypt it in a flash application that I run on the same webpage, to which I pass the encrypted string as a JavaScript variable. I generate a 128bit key using Java. I can do encryption/decryption in Java successfully. Java outputs byte-array (byte[]) for the key, encrypted and decrypted result. I use Base64 encoding/decoding to successfully get the string equivalent. On the flash

MySQL AES_DECRYPT returns NULL

霸气de小男生 提交于 2019-12-11 17:38:10
问题 I have a MySQL issue. I want to decrypt a blob with AES_DECRYPT and try it in phpMyAdmin with a query SELECT key_value ,AES_DECRYPT(key_value,'crypt_key')FROM `ps_keymanager` WHERE `id_keymanager`=1497 the query works, but it returned me NULL and not the decrypted value :( 回答1: Try casting SELECT key_value , CAST (AES_DECRYPT(key_value,'crypt_key')AS CHAR(50)) FROM `ps_keymanager` WHERE `id_keymanager`=1497 来源: https://stackoverflow.com/questions/36022928/mysql-aes-decrypt-returns-null

Data decryption in case of modified cipher data

≯℡__Kan透↙ 提交于 2019-12-11 17:25:54
问题 In this example, I am trying to encrypt audio file header and data using CipherOutputStream. I stored the corresponding IV1 to file. Later, I encrypted the updated header and overwrote the previous cipher data. I stored the corresponding IV2 to file. I feel the IV1 written to file will no longer useful, because I overwritten the first header cipher data. On decryption side, by using IV2 I am able to decrypt updated header part only. I am unable to decrypt the actual data even though I used

How to store the encryption key safely?

荒凉一梦 提交于 2019-12-11 17:12:47
问题 I am using MySQL as a back end storage. I was asked by our risk management team to encrypt all the data prior storing it into the database. Since then I have been doing research on how to secure the data going in and out the database. I found couple ways one of them was MySQL Encryption Software A second solution was to encrypt and decrypt data in MySQL using AES_ENCRYPT() AND AES_DECRYPT(). But I will need to create a 128,196 or 256 bit key in order to be able to encrypt and decrypt the data

Porting C# AES Encryption to Javascript for Node.js

最后都变了- 提交于 2019-12-11 16:09:31
问题 Looking for help to port below C# code into Node.js using crypto or equivalent module. private string password="FlU4c8yQKLkYuFwsgyU4LFeIf7m3Qwy+poMBdULEMqw="; private byte[] salt = Encoding.ASCII.GetBytes("##oEDA102ExChAnGe99#$#"); Aes encryptor = Aes.Create(); Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(password, salt); string pdbStr = Convert.ToBase64String(pdb.GetBytes(32)); Console.WriteLine(pdbStr); encryptor.Key = pdb.GetBytes(32); encryptor.IV = pdb.GetBytes(16); Tried porting into

Get a C# byte array equal to a php hex string

无人久伴 提交于 2019-12-11 15:38:52
问题 So I have this piece of php code that I'm not allowed to modify for now, mainly because it's old and works properly. Warning! Very bad code overal. the IV is not being randomized neither stored with the output. I'm not asking this because I want to, I'm asking because I need to. I'm also planning on refactoring when I get this working and completing my C# code with actually reliable cyphering code. function encrypt($string) { $output = false; $encrypt_method = "AES-256-CBC"; $param1 =

Encrypting any file using AES

拜拜、爱过 提交于 2019-12-11 13:46:45
问题 I'm using some code like this to encrypt a file. FileStream fsInput = new FileStream(ifile_path, FileMode.Open, FileAccess.Read); FileStream fsEncrypted = new FileStream(ofile_path, FileMode.Create, FileAccess.Write); AesCryptoServiceProvider AES = new AesCryptoServiceProvider(); AES.Mode = CipherMode.CBC; AES.KeySize = 256; iv = AES.IV; AES.Key = key; ICryptoTransform aesencrypt = AES.CreateEncryptor(); CryptoStream cryptostream = new CryptoStream(fsEncrypted, aesencrypt, CryptoStreamMode

AesCryptoServiceProvider.TransformFinalBlock error: The input data is not a complete block

血红的双手。 提交于 2019-12-11 13:33:57
问题 I wrote what was supposed to be a simple encrypt/decrypt application to familiarize myself with the AesCryptoServiceProvider and I am receiving an error. The error is "The input data is not a complete block." Here is the code: static void Main(string[] args) { Console.WriteLine("Enter string to encrypt:"); string userText = Console.ReadLine(); byte[] key; byte[] IV; using (AesCryptoServiceProvider aes = new AesCryptoServiceProvider()) { key = aes.Key; IV = aes.IV; } byte[] encryptedText =