rijndael

How can I encrypt and decrypt using AES 128 without an IV?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 15:19:34
问题 I'm currently needing a way to encrypt a string and decrypt a byte array using AES-128 symmetrical encryption, in C#. I can't find a way how to do this, but maybe I've missed something. 回答1: Import namespaces using System; using System.IO; using System.Text; using System.Security.Cryptography; static void Main(string[] args) { string value = "@arifansari300<3>"; string encryptedValue= EncryptDecrypt.Encrypt(value); string decryptedValue = EncryptDecrypt.Decrypt(encryptedValue); } public

Rewrite PHP Rijndael algorithm to Java (Android)

两盒软妹~` 提交于 2019-11-27 14:15:50
问题 I need to encode a string in Java and php where the result must be the same. The following conditions are given: algorithm: RIJNDAEL-128 key: 5P443m2Q1R9A7f5r3e1z08642 mode: ECB initialization vector: N/A (Since we're using ECB, IV's are ignored) String to encode: 201412181656005P443m2Q1R9A7f5r3e1z08642 PHP <?php class Cipher { private $securekey, $iv; function __construct($textkey) { $this->securekey = $textkey; $this->iv = mcrypt_create_iv(32); } function encryptR($input) { $enc = mcrypt

How to decode Rijndael in ruby (encoded in VB.net)

僤鯓⒐⒋嵵緔 提交于 2019-11-27 06:31:42
问题 I am using Rinjael to encode in VB.NET and need to decode in Ruby. My VB.NET encryption class looks like this: Private Class Encryptor Private symmetricKey As System.Security.Cryptography.RijndaelManaged Private iVector As Byte() Private Key As Byte() Public Function encrypt(ByVal data As String) As String Try Dim plainTextBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(data) Dim encryptor As System.Security.Cryptography.ICryptoTransform = symmetricKey.CreateEncryptor(Key, iVector) Dim

Rijndael 256 Encrypt/decrypt between c# and php?

若如初见. 提交于 2019-11-27 04:53:15
UPDATED I have made the changes to the C# code so it uses a block size of 256. but now the hello world looks like this http://pastebin.com/5sXhMV11 and I cant figure out what I should use with rtrim() to get ride of the mess at the end. Also when you say the IV should be random, by this do you mean don't use the same IV more then once or is the way I have coded it wrong? Thanks again! Hi, I'm trying to decrypt a string with PHP that was encrypted in C#. I can't seem to get PHP to decrypt it using mcrypt and could do with some help please. I get the following error with php so I am guessing I'm

How to encrypt in VBScript using AES?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 02:17:50
问题 I am looking to encrypt some data using Rijndael/AES in VBScript using a specific key and IV value. Are there any good function libraries or COM components that would be good to use? I looked at CAPICOM; it allows a passphrase only, and won't allow setting specific key and IV values. 回答1: Old question- that really never gets old! One way is to declare encryption classes within vbscript, without needing external added COM objects or wrapper. The following example takes a string, encrypts and

How to generate Rijndael KEY and IV using a passphrase?

浪尽此生 提交于 2019-11-26 19:09:19
问题 How to generate Rijndael KEY and IV using a passphrase? The key length must be in 256 bits. 回答1: This is plug and play code that I found on internet. It just works: using System.IO; using System.Security.Cryptography; private static readonly byte[] SALT = new byte[] { 0x26, 0xdc, 0xff, 0x00, 0xad, 0xed, 0x7a, 0xee, 0xc5, 0xfe, 0x07, 0xaf, 0x4d, 0x08, 0x22, 0x3c }; public static byte[] Encrypt(byte[] plain, string password) { MemoryStream memoryStream; CryptoStream cryptoStream; Rijndael

How do I convert this C# Rijndael encryption to PHP?

穿精又带淫゛_ 提交于 2019-11-26 17:19:27
问题 There are already some helpful questions on SO: Rijndael 256 Encrypt/decrypt between c# and php? Rewrite Rijndael 256 C# Encryption Code in PHP Rijndael/AES decryption C# to PHP conversion However I am still having difficulties with my particular case. I've tried various methods but end up getting the error "The IV parameter must be as long as the blocksize" or text that doesn't match the resulting hash. I don't understand encryption enough to work out what I'm doing wrong. Here is the php

How to encrypt or decrypt with Rijndael and a block-size of 256 bits?

送分小仙女□ 提交于 2019-11-26 06:46:27
问题 For certain reasons I need to implement Rijndael de/compression with a blocksize of 256 bits instead of AES which uses a block size of 128 bits (reason: data is encrypted in PHP using Rijndael...). How can I change the block-size for a cipher? If i just get a cipher with \"RIJNDAEL/CFB/PKCS5Padding\" and try to initialize a IV with 256 bits I get an exception, because the block-size is only 128 bits. 回答1: There is no support in any of the Sun JCE providers for anything other than Rijndael