aes

The data to be decrypted exceeds the maximum for this modulus of 128 bytes

最后都变了- 提交于 2019-12-11 04:32:06
问题 I'm trying to establish a secure connection between a Client and a Server with RSA/AES (i think you know how that works) now my Problem is, i get that error message written in the title. I know, there are 2 or 3 other threads with the same title, but all of them try to en- and decrypt from a file on the pc. i get that error at the encryption of the AES key which was encrypted using the RSA public key which is the normal way to do as i know. here my "Client" and "Server" applications Client:

AES128 bit encryption string is not similar as on .net

老子叫甜甜 提交于 2019-12-11 04:21:43
问题 I am Implementing the AES128 bit encryption/Decryption in iOS application for sending/receiving data from .net server, I almost done but during unit testing I got some issue in encryption string, some encrypted string are not similar as on .net server, Can say 98 percent strings are correct at both side but issue comes in 2 percent strings , when I match the both side encrypted string then found at iOS end generated string is little short and .net end it is long string. One more thing i found

Encode and decode a string, with password and salt, in dotnet core

蓝咒 提交于 2019-12-11 04:06:24
问题 I've been working on a simple helper for dotnet core that should encode and decode a string, based on a user provided password (key) and a salt. In contradiction to the full .NET Framework, dotnet core currently does not have an implementation for the RijndaelManaged class. Pretty much every decent encrypt/decrypt sample for C# is based on this class, rendering it useless for dotnet core. There is a lot of debate on it on the CoreFX repo on GitHub. However, with the combination of both the

NSData with CCCrypt in multi-threaded environment

巧了我就是萌 提交于 2019-12-11 03:39:00
问题 I have a file that was encrypted using AES. I use the following NSData category: #import <CommonCrypto/CommonCryptor.h> @implementation NSData (AES) - (NSData *)AES256DecryptWithKey:(NSString *)key { // 'key' should be 32 bytes for AES256, will be null-padded otherwise char keyPtr[kCCKeySizeAES256+1]; // room for terminator (unused) bzero(keyPtr, sizeof(keyPtr)); // fill with zeroes (for padding) // fetch key data [key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];

Creating My Symmetric Key in C#

假如想象 提交于 2019-12-11 03:34:15
问题 Have been reviewing some symmetric cryptography approaches I've seen a lot of examples that hard code a private static variable in a class, usually something along the lines of: string key = "THISISYOURENCRYPTIONKEY!" and then somewhere further down, the code uses it for encrypting/decrypting. Putting aside the correct implementation/algorithm/strategy as well as where to store it, I have one simple question. What should the value of my key be? I.e. how do I generate it? Most of the examples

HMAC-SHA256 with AES-256 in CBC mode

断了今生、忘了曾经 提交于 2019-12-11 03:33:09
问题 I recently came across the following code sample for encrypting a file with AES-256 CBC with a SHA-256 HMAC for authentication and validation: aes_key, hmac_key = self.keys # create a PKCS#7 pad to get us to `len(data) % 16 == 0` pad_length = 16 - len(data) % 16 data = data + (pad_length * chr(pad_length)) # get IV iv = os.urandom(16) # create cipher cipher = AES.new(aes_key, AES.MODE_CBC, iv) data = iv + cipher.encrypt(data) sig = hmac.new(hmac_key, data, hashlib.sha256).digest() # return

Encrypting Files with AES, Encrypting Key with RSA - Am I on the right track?

别来无恙 提交于 2019-12-11 03:05:38
问题 Overview: I'm trying to design an application that will encrypt files to safely send through Snail Mail (LARGE sets of data). I'm planning on using AES/RijndaelManaged encryption from .Net to encrypt the files initially, using a randomly generated key using RNGCryptoServiceProvider . I'm then encrypting this random AES key with a RSA Public key. The receiver of the data is the only one with the RSA Private key to decrypt it. My question: Is this the proper way to do something like this? If so

AES-256 encryption workflow in scala with bouncy castle: salt and IV usage and transfer/storage

帅比萌擦擦* 提交于 2019-12-11 02:59:40
问题 I'm trying to implement secure encryption of the files to be sent over insecure channel or stored in an insecure place. I use bouncy castle framework, my code is written in scala. I decided to use aes-256 (to be more specific - Rinjael with 256 bit block size, here is why). And it seems like I can use Rinjael with any (128|160|192|256) block length. I cannot understand the whole process overview correctly. Here is one of good answers, in this question there is some useful code specific to

C# AES Encryption in CFB Where Plaintext Length Equals Encrypted Length

流过昼夜 提交于 2019-12-11 02:49:46
问题 I have an existing data format that has portions of it encrypted in what appears to be AES in CFB mode. The plaintext data length and the encrypted data length are the same. In C#, pretty much every angle I've taken seems to expect the encrypted length to be a multiple of the block size... so I get an exception trying to decrypt the data. In researching solutions, I've used Crypto++ and wrote a quick C++ app that successfully decrypts the data, so I'm pretty sure I'm using the right algorithm

Decrypting AES in SQL Anywhere 16 encrypted in C# and vise versa

不羁的心 提交于 2019-12-11 02:35:25
问题 I have this peace of code that encrypts stuff using AES, to be more precise Rijndael algorithm to mimic (http://dcx.sybase.com/index.html#sa160/en/dbreference/encrypt-function.html) the behaviour of SQL Anywhere 16, for sake of examples simplicity keys are fake: var Key = Encoding.ASCII.GetBytes("1234567812345678"); var IV = Encoding.ASCII.GetBytes("1234567812345678"); var text = "stuff"; string encrypted; var aes = new RijndaelManaged { Mode = CipherMode.CBC, Padding = PaddingMode.PKCS7,