rijndael

PHP Encryption & VB.net Decryption

匆匆过客 提交于 2019-12-03 03:46:45
I'm trying to do a simple task. Encypt a value in PHP and Decrypt it in my VB.net app. I figure I'd use tripleDES or Rijdael 128 or 256 I though this should be simple. Can anyone point me in the right direction? Thank you We have some ciphers working between C# on .NET and PHP. I am not familiar with VB.net. I assume it uses the same crypto library System.Security.Cryptography . On PHP side, we switched from mcrypt to OpenSSL because some modes and paddings are not supported by mcrypt. As long as you use same algorithm (DES, AES etc), same mode (CBC, ECB etc), same padding (PKCS1, PKCS5), the

How to store the key used to encrypt files

三世轮回 提交于 2019-12-03 03:06:50
I'm playing around with an app to backup files to "the cloud" :) and I want to encrypt the files before I store them. That part I have covered, but as this app will be monitoring folders for change and uploading the changed files I need to store the key that I use to encrypt the files with. The idea is that the user provides a password and a key is generated. At the moment I'm using the .NET Framework to do the encryption. I'm using the RijndaelManaged class to encrypt/decrypt and the PasswordDeriveBytes class to get the key. But how should I keep the key that is used for encrypting the files?

Decrypting a Text File Using Rjindael

泪湿孤枕 提交于 2019-12-02 13:04:32
I have used this guide to encrypt the value of txtCode.Text into a text file, which is then hidden - The value of the encrypted data is going to be used as the password for the database, so I need to read this value, decrypt it, then pass it into the connection string. However, in this guide, the decryption is done by typing in a value, creating a bytKey and bytIV and then comparing the result of encryption of the newl typed string with the value in the text file. Obviously I can't ask the user to enter the password every time the database needs to be opened, so how can I achieve decryption

Rijndael alternative for Linux

£可爱£侵袭症+ 提交于 2019-12-02 10:48:17
问题 I have a project in c#, Windows that uses Rijndael object. I'm suppoesd to write it in c++,Linux. I understood that I'm supposed to use openssl/aes, but couldn't figure out how. What are the includes? what is the class name? the methods? what should I use instead of: Rijndael.create(), Rijndael.KeySize(),Rijndael.IV(), etc. Thanks in Advance. Sara 回答1: Example source code is available here. Make sure you link with -lcrypto . EDIT the link currently does not work; I copy the source from an

Delphi AES library (Rijndael) tested with KAT Vectors

梦想与她 提交于 2019-12-02 07:43:31
for these 2 libraries, Delphi Encryption Compendium v 5.2 TurboPower Lockbox v 2.07 I tested their Rijndael DCB/CBC algorithm with "AES Known Answer Test (KAT) Vectors" obtained at NIST website ( http://csrc.nist.gov/groups/STM/cavp/index.html ) But, both of these libraries failed the tests. Not sure if it was my testing that has error, has anyone tested them before as well? I am looking for a Delphi Rijndael library that is able to pass the KAT Vectors test. Does anyone know of any such library? Are you sure it fails? The vectors are written as hex strings. Did you feed the hex strings as

RijndaelManaged.CreateEncryptor key expansion

孤街醉人 提交于 2019-12-02 04:02:01
问题 There are two ways to specify a key and an IV for a RijndaelManaged object. One is by calling CreateEncryptor : var encryptor = rij.CreateEncryptor(Encoding.UTF8.GetBytes(key), Encoding.UTF8.GetBytes(iv))); and another one by directly setting Key and IV properties: rij.Key = "1111222233334444"; rij.IV = "1111222233334444"; As long as the length of the Key and IV is 16 bytes, both methods produce the same result. But if your key is shorter than 16 bytes, the first method still allows you to

Bad PKCS7 Padding error: Invalid length 106

感情迁移 提交于 2019-12-01 13:23:26
I'm trying to encrypt and decrypt with the following functions, however, it results in a bad padding error. If I set PaddingMode to None it returns some alpha characters and random symbols in Log. I'm possibly missing something from setting the correct structure which is as follows: Cipher Rijndael (AES) Block Size 128 bits (16 bytes) Mode CBC (Cipher Block Chaining) Key MD5 hash passphrase IV Same as the key Data Encoding Base64 Character UTF-8 Encoding Any help fixing this error and any assistance with ensuring the above structure is met would be greatly appreciated! Thanks Error

Bad PKCS7 Padding error: Invalid length 106

↘锁芯ラ 提交于 2019-12-01 11:41:38
问题 I'm trying to encrypt and decrypt with the following functions, however, it results in a bad padding error. If I set PaddingMode to None it returns some alpha characters and random symbols in Log. I'm possibly missing something from setting the correct structure which is as follows: Cipher Rijndael (AES) Block Size 128 bits (16 bytes) Mode CBC (Cipher Block Chaining) Key MD5 hash passphrase IV Same as the key Data Encoding Base64 Character UTF-8 Encoding Any help fixing this error and any

rijndael encryption - only part of the string is decrypted

北慕城南 提交于 2019-12-01 09:31:39
Only part of the string is getting decrypted, i think it has to do with my encoding. Here is what happens: string s = "The brown fox jumped over the green frog"; string k = "urieurut"; string enc = EncryptString(s, k); string dec = DecryptString(enc, k); The RESULT is this: The brown fox juϼ㴘裴혽Ή⪻ㆉr th≸ g⟤een frog public static string EncryptString(string stringToEncrypt, string encryptionKey) { string encrypted = String.Empty; UnicodeEncoding UE = new UnicodeEncoding(); byte[] key = UE.GetBytes(encryptionKey); RijndaelManaged RMCrypto = new RijndaelManaged(); MemoryStream ms = new

rijndael encryption - only part of the string is decrypted

自作多情 提交于 2019-12-01 08:25:34
问题 Only part of the string is getting decrypted, i think it has to do with my encoding. Here is what happens: string s = "The brown fox jumped over the green frog"; string k = "urieurut"; string enc = EncryptString(s, k); string dec = DecryptString(enc, k); The RESULT is this: The brown fox juϼ㴘裴혽Ή⪻ㆉr th≸ g⟤een frog public static string EncryptString(string stringToEncrypt, string encryptionKey) { string encrypted = String.Empty; UnicodeEncoding UE = new UnicodeEncoding(); byte[] key = UE