rijndael

Help using Rijndael Algorithm in Delphi 2007. Net

和自甴很熟 提交于 2019-12-04 18:54:09
I'm working in Delphi 2007. Net, where I can find an example of using the Rijndael algorithm. Bye. Some time ago I wrote this code, should work ok. uses System.Security.Cryptography, System.Text; type TDynamicArrayOfByte = array of Byte; function Encrypt(StrtoEncrypt, PK: string): TDynamicArrayOfByte; // pk, must be of a string of 32 characters var miRijndael: Rijndael; encrypted: TDynamicArrayOfByte; toEncrypt: TDynamicArrayOfByte; bytPK: TDynamicArrayOfByte; i: integer; begin Result := nil; miRijndael := System.Security.Cryptography.RijndaelManaged.Create; try toEncrypt := System.Text

Rijndael encryption from Action Script to C#

你说的曾经没有我的故事 提交于 2019-12-04 18:06:24
I am trying to share encryption between Action Script and C# My task is to decrypt the following message within C# f1ca22a365ba54c005c3eb599d84b19c354d26dcf475ab4be775b991ac97884791017b12471000def05bb77bfe9c3a97d44ef78c9449f12daf6e25b61ab1a281 It uses Rijndael encyption , ECB mode (electronic code book), Key: Pas5pr@se , 128 bit key size and block size. The problem I have is I can't seem to do it, anyone help me on this? This is an implementation of Rijndael Encryption which one of my websites is currently using. See if this does the trick: using System; using System.IO; using System.Security

Delphi DEC library (Rijndael) encryption

前提是你 提交于 2019-12-04 11:34:58
问题 I am trying to use the DEC 3.0 library (Delphi Encryption Compedium Part I) to encrypt data in Delphi 7 and send it to a PHP script through POST, where I am decrypting it with mcrypt (RIJNDAEL_256, ECB mode). Delphi part: uses Windows, DECUtil, Cipher, Cipher1; function EncryptMsgData(MsgData, Key: string): string; var RCipher: TCipher_Rijndael; begin RCipher:= TCipher_Rijndael.Create(KeyStr, nil); RCipher.Mode:= cmECB; Result:= RCipher.CodeString(MsgData, paEncode, fmtMIME64); RCipher.Free;

Decrypting a Text File Using Rjindael

梦想的初衷 提交于 2019-12-04 06:52:18
问题 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

Rijndael 256 encryption: Java and .NET do not match

☆樱花仙子☆ 提交于 2019-12-04 06:00:11
I need to translate a powershell script with Rijandael encryption to Java. Here is the source powershell code: [Reflection.Assembly]::LoadWithPartialName("System.Security") Add-Type -AssemblyName System.Web $sKy = "bbee9a3e8e44e28edb4539186d182aaa" $sIV = "131a68dc13160766f37dc931d7e518aa" $myRijndael = New-Object System.Security.Cryptography.RijndaelManaged $myRijndael.KeySize = 256 $myRijndael.BlockSize = 256 $myRijndael.Mode = [System.Security.Cryptography.CipherMode]::CBC $myRijndael.Padding = [System.Security.Cryptography.PaddingMode]::Zeros [byte[]] $key = [Text.Encoding]::ASCII.GetBytes

Rijndael AES-128 encryption decryption in Ruby

烈酒焚心 提交于 2019-12-03 21:51:52
I want to use rijndael aes128 for encryption in ruby. I have this code: cipher = OpenSSL::Cipher::Cipher.new("aes-128-cbc") cipher.encrypt cipher.key = 'abcdef0123456789abcdef0123456789' cipher.iv = '0000000000000000' encrypted = cipher.update('2~1~000024~0910~20130723092446~T~00002000~USD~F~375019001012120~0~0~00000000000~') encrypted << cipher.final which is not working. But using this PHP function: <?php function hex2bin($hex_string) { return pack('H*', $hex_string); } $data_to_encrypt = '2~1~000024~0910~20130723092446~T~00002000~USD~F~375019001012120~0~0~00000000000~'; $key =

Encrypt and decrypt doesn't give the same plain text using AES/ECB/NoPadding

落爺英雄遲暮 提交于 2019-12-03 21:28:06
String plain1= "Test"; byte[] cipher = SplashSecure.getInstance().encrypt2(plain1); String plain2 = SplashSecure.getInstance().decrypt2(cipher); plain = Test������������������������ After decryption plainText2 should be equal to plaintext . But it's not. Encrypt/Decrypt methods. public void initKey(String key) { String paddedKey = Utils.padString(key); mKeyspec = new SecretKeySpec(Utils.getBytes(paddedKey), "AES/ECB/NoPadding"); // Utils.getBytes returns "paddedKey.getBytes("CP1252")" } public byte[] encrypt2(String data) { try { Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding"); cipher

How to store the key used to encrypt files

会有一股神秘感。 提交于 2019-12-03 12:43:01
问题 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

Encryption / Decryption using Rijndael with key 256bit on Android

我是研究僧i 提交于 2019-12-03 10:15:00
I am developing an Android application that consumes a WS. For exchange of information between the android application and WebService, you must use the algorithm encryption / decryption Rijndael with 256 bit key. That is, all the information returned from the WS, will be encrypted, so I decrypts them using the algorithm. Likewise, all the information I send to WS should be encrypted. Therefore, I will use the encryption algorithm. I have not found the Rijndael ready to be used in the android platform. But I have the same algorithm in C #. public class KeydKey { public KeydKey() { } #region

Delphi DEC library (Rijndael) encryption

筅森魡賤 提交于 2019-12-03 08:13:41
I am trying to use the DEC 3.0 library ( Delphi Encryption Compedium Part I ) to encrypt data in Delphi 7 and send it to a PHP script through POST, where I am decrypting it with mcrypt (RIJNDAEL_256, ECB mode). Delphi part: uses Windows, DECUtil, Cipher, Cipher1; function EncryptMsgData(MsgData, Key: string): string; var RCipher: TCipher_Rijndael; begin RCipher:= TCipher_Rijndael.Create(KeyStr, nil); RCipher.Mode:= cmECB; Result:= RCipher.CodeString(MsgData, paEncode, fmtMIME64); RCipher.Free; end; PHP part: function decryptMsgContent($msgContent, $sKey) { return mcrypt_decrypt(MCRYPT_RIJNDAEL