aes

How do I decrypt an AES key using C# Bouncy Castle that was encrypted using Libgcrypt raw flag

你离开我真会死。 提交于 2019-12-24 19:58:56
问题 Summary: I am attempting to decrypt (and eventually encrypt and return) files that are AES128 encrypted. The AES key is encrypted using libcrypt's RSA provider. When I attempt to decrypt the AESKey on Windows 7 using C# & BouncyCastle a "block truncated" error is thrown when I call "ProcessBlock". I have tried converting the data to BigEndian and I'll get a "Not a valid RSA exponent" when I try to create the RsaKeyParameters. The encryption was done using libgcrypt 1.2x on a linux system. I

c# Encryption in a multi-layered Streams read/write

自古美人都是妖i 提交于 2019-12-24 18:28:40
问题 There are files created from multiple layers of data: //input is not always the same, but the structure is, so for example there might be h4 and h5, but I will know that, so that is not the problem private void generalizationofwrittendata(string filename, int someint, int chunks, string outputfilename, ICryptoTransform crypt, byte[] somedata, int h1, int h2, int h3) { using (FileStream fs = new FileStream(outputfilename, FileMode.Create, FileAccess.Write)) { using (BinaryWriter w = new

Sage Pay Forms V3.00 AES-128 Encryption VB.Net

微笑、不失礼 提交于 2019-12-24 16:22:24
问题 I thought I would post this as I did not find an off-the-shelf solution for the AES encryption needed for the V3.00 upgrade. The SagePay C# solution example for some reason did not have have an encryption/decryption code example in it as far as I could see. I cobbled together the code from existing posts and the RijndaelManaged Class VB example (https://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1)....

CryptoJS AES Increase File Size

你。 提交于 2019-12-24 13:26:32
问题 Thank you for your help. I have a problem with sjcl library or cryptojs aes library. Everytime i encrypt my file with aes the file size is * 2. For example: When i upload a 4mb file then there is a 8mb file on my server. I split the file on block which bytesize can be divided by 16. Please help me This is the way i encrypt the file: var l_EncryptetData = CryptoJS.AES.encrypt(p_ChunkData, p_FileKey).toString(); And this is a example array with block sizes from the 4mb file: 0: 1572864 1:

sharing & storing IV for AES Encryption/decryption

a 夏天 提交于 2019-12-24 13:05:27
问题 I am currently using AES-ECB encryption for user passwords on an android app, but I have to connect this app's database to a website where users can register and log in the same way as the mobile app. I have read that ECB mode is not secured, so I wanted to use CBC by generating an IV. Is it secure to store an IV as a constant in the code (I store the secret key this way too), both in php on the server side, and in the app ? If not, is there a way for the website and the mobile app to share

C# Decrypting AES/ECB Paddded Using PKCS#5

♀尐吖头ヾ 提交于 2019-12-24 11:53:24
问题 I'm making a small application for fun in C# which retrieves a image from a server which is encrypted using AES/ECB with a single synchronous key (which I know) and padded using PKCS#5. I tried just downloading the image by using a BinaryReader, however when I go to open the image, it is a corrupt file. I assume this is because it is encrypted. Here is my code: string repsonseData = string.Empty; using (var response = (HttpWebResponse)req.GetResponse()){ using (var reader = new BinaryReader

Python AES import error Please

只愿长相守 提交于 2019-12-24 10:36:07
问题 I have AES inside Cipher inside Crypto(Python27\Lib\Crypto\Cipher\AES module) When I try to import AES from Crypto.Cipher import AES I get the following error: Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> from Crypto.Cipher import AES File "C:\Python27\lib\Crypto\Cipher\AES.py", line 50, in <module> from Crypto.Cipher import _AES ImportError: cannot import name _AES But I can import another module like from Crypto.Cipher import blockalgo working fine. So I'm

AES256 Encryption/Decryption speed

北慕城南 提交于 2019-12-24 10:26:21
问题 I am writing an application which encrypts and decrypts files. I am using CipherInputStream and CipherOutputStream for enryption/decryption process using AES256 bit cipher. My problem is if I take byte array and write to file makeing encryption on the fly it takes about 2 times less time than if I decrypt file creating a byte array. It is strange because as I know AES encryption and decryption are symmetric processes and they should take same amount of time to complete. Any ideas? 回答1: There

AES Encryption PHP to NodeJS?

*爱你&永不变心* 提交于 2019-12-24 10:23:01
问题 I am in process of moving a small project from PHP to NodeJS that includes a small part of AES Encryption. As PHP code works fine, it goes as function decysek($data, $app_key) { $output = openssl_decrypt(base64_decode($data), 'AES-256-ECB', $app_key, OPENSSL_RAW_DATA); return $output; } function decyGetBillData($rek , $data , $decrypted_sek){ $decrypted_rek = openssl_decrypt(base64_decode($rek), 'AES-256-ECB', $decrypted_sek, OPENSSL_RAW_DATA); $decrypted_data = openssl_decrypt(base64_decode(

OpenSSL EVP_CIPHER_CTX_set_padding not working

℡╲_俬逩灬. 提交于 2019-12-24 08:00:00
问题 I am trying to encrypt/decrypt using AES, CBC and PKCS#7 padding using the EVP interface. I am using the example found on the Wiki. I am doing EVP_CIPHER_CTX_set_padding(ctx, 0) after creating and initializing the context which should not add padding and fail if the plaintext is not a multiple of 16 bytes. Despite this the ciphertext always contains an extra block made up of padding only. The code I am using is literally copied and pasted from the tutorial, I am only adding EVP_CIPHER_CTX_set