aes

Rijndael Padding Error

耗尽温柔 提交于 2019-12-07 07:01:58
问题 Hello I am trying to encrypt / decrypt a string via Rijaendal. I simply can't figure out why the decryption blows up. I always end up with an incorrect padding error. One thing that throws me off is the result of my encryption which I return as HEX array. It has a length of 14 bytes. In my decryption function, the same byte array ends up having 16 bytes upon conversion from HEX. Any help would be appreciated: using System; using System.Collections.Generic; using System.Linq; using System.Text

Java Cipher - PBE thread-safety issue

人盡茶涼 提交于 2019-12-07 06:28:48
问题 It seems that I have a thread-safety issue with Cipher and/or PBEKeySpec. JDK : 1.8.0_102, 1.8.0_151 and 9.0.1+11 PBKDF2 algorithm: PBKDF2WithHmacSHA1 Cipher algorithm: AES/CFB/NoPadding Key algorithm: AES I know these classes aren't tread-safe if we use the same instances, but that's not the case, I'm getting a new instance at each decode. But even that, sometimes the decode fails, there is no exception, just an unexpected decoded value. I've been able to reproduce the problem: @Test public

For AES128 using CCCrypt() can the key be longer than 128 bits?

血红的双手。 提交于 2019-12-07 05:51:35
问题 I am using the CCCrypt method. Can I use a longer key than than 128bit? Can it be arbitrarily long? Or perhaps multiples of 128? If so how would I do this? I didn't think this woas possible but I found this text: here Some algorithms such as AES and RSA allow for keys of different lengths , but others are fixed, such as DES and 3DES. Encryption using a longer key generally implies a stronger resistance to message recovery. As usual, there is a trade off between security and time, so choose

How Can We Use GCM Mode Encryption in PHP?

↘锁芯ラ 提交于 2019-12-07 05:04:29
问题 I have been reading a lot about GCM and how awesome it is and I would like to know how could I use AES-GCM authenticated encryption using PHP . Is it supported in mcrypt() ? I found some references to GCM in the Codeigniter framework documentation which leads me to believe it is possible to use in Codeigniter. And I also came across something in a doc about Zend . I'm not looking to use a Codeigniter driver though as I don't use any framework and don't intend to for my current projects. It

How can I mcrypt 128 CFB to Ruby?

时间秒杀一切 提交于 2019-12-07 04:38:25
问题 I need to exchange with a PHP API which crypts the requests and answers. On my side I am in rails 4.0.0 (ruby 2.0) and I cannot make it work. I have read a lot of answers on this subject and have tried to understand how mcrypt works, e.g. http://www.chilkatsoft.com/p/php_aes.asp, but without success. I still cannot decrypt the encrypted from PHP or encrypt something that the PHP can decrypt Could you help me please and see what I am doing wrong? PHP code: $secretKey = "1234567891234567";

.NET's SslStream is always negotiating to the least secure cipher I have. How can I change this?

喜欢而已 提交于 2019-12-07 04:29:11
问题 SslStream is supposed to negotiate the cipher type, key length, hash algorithm, etc. with its peer SSL stack. When using it in my code, I find that the negotiation always defaults to RC4 & MD5. I would like to use 3DES or AES for some added security. Looking around the web I find only a few references to this problem and no solutions; one poster is claiming this actually makes sense, since the lowest common denominator between the two stacks is secure while has the added benefit of being

Decrypt string using AES/CBC/NoPadding algorithm

孤者浪人 提交于 2019-12-07 04:18:57
问题 I want to decrypt an Encrypted Sting using AES/CBC/Nopadding in c# Windows Phone 8 application. My string is in file of IsolatedSorage . I pasted the string HERE which is junk. From this Article I am using AesManaged class to decrypt. But how to set padding to NoPadding because by default the padding set to PKCS7 from here. string fileName = "titlepage.xhtml"; if (fileStorage.FileExists(fileName)) { IsolatedStorageFileStream someStream = fileStorage.OpenFile(fileName, System.IO.FileMode.Open,

Pycrypto : AES Decryption

橙三吉。 提交于 2019-12-07 03:49:55
问题 Why Pycrypto AES decryption gives different output when decrypted with AES object used for encryption and right output when decrypted with AES object used solely for decryption? from Crypto.Cipher import AES obj = AES.new('0123456789012345', AES.MODE_CBC, '0123456789012345') message = '0123456789012345' ciphertext = obj.encrypt(message) plaintext = obj.decrypt(ciphertext) # plaintext here is byte array obj2 = AES.new('0123456789012345', AES.MODE_CBC, '0123456789012345') plaintext = obj2

How to decompress an AES-256 Encrypted zip files?

被刻印的时光 ゝ 提交于 2019-12-07 03:33:54
问题 I am developing an android application which requires to decompress an AES-256 encrypted zip files, is there any libraries out there that I can use to accomplish that? I am greatly appreciative of any guidance or help. 回答1: zip4j , java library to handle Zip files (Open source, Apache License v2.0). http://www.lingala.net/zip4j/ Create, Add, Extract, Update, Remove files from a Zip file Read/Write password protected Zip files Supports AES 128/256 Encryption Supports Standard Zip Encryption

Encrypting a value using MySQL's AES_ECRYPT function, then passing it in a URL string, using PHP

依然范特西╮ 提交于 2019-12-07 00:55:29
I need to encrypt a string using MySQL's AES_ENCRYPT function, then attach that encrypted string to the end of a URL, such that it can then be decrypted and used by a PHP script on the other end. Basically, I am encrypting the string (using MySQL's AES_ENCRYPT), I am then using PHP's rawurlencode() function to make it "URL safe". I then pass the encrypted string in a URL, which is then retrieved by the PHP script on the other end where it gets successfully decrypted... about 95% of the time. Seems as though about 5% of strings are encrypting in such a way that they are getting corrupted