3des

Decrypting a string in ColdFusion encrypted with 3DES in C#

懵懂的女人 提交于 2019-12-01 19:59:48
We are having difficulty decrypting a string in ColdFusion that was previously encrypted with 3DES and C#. Here is the code we used to encrypt the string initially: public static string EncryptTripleDES(string plaintext, string key) { TripleDESCryptoServiceProvider DES = new TripleDESCryptoServiceProvider(); MD5CryptoServiceProvider hashMD5 = new MD5CryptoServiceProvider(); DES.Key = hashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(key)); DES.Mode = CipherMode.ECB; ICryptoTransform DESEncrypt = DES.CreateEncryptor(); byte[] Buffer = ASCIIEncoding.ASCII.GetBytes(plaintext); string EncString =

3des encryption and decryption in iOS

笑着哭i 提交于 2019-12-01 11:01:25
I am working on 3DES encryption and decryption. I have done encryption successfully. For decryption, I am using this code but not getting exact result. My encryption string is " CHc3TsfJgYs= " and key is " meristem ". Please tell me what I am doing wrong? NSString *token = @"CHc3TsfJgYs="; NSString *key = @"meristem"; const void *vplainText; size_t plainTextBufferSize; plainTextBufferSize = [token length]; vplainText = (const void *) [token UTF8String]; CCCryptorStatus ccStatus; uint8_t *bufferPtr = NULL; size_t bufferPtrSize = 0; size_t movedBytes ; bufferPtrSize = (plainTextBufferSize +

Encrypting/decrypting 3DES in Ruby

时光毁灭记忆、已成空白 提交于 2019-12-01 05:27:25
I have a key.bin file which content is something along the lines of: -12, 110, 93, 14, -48, ... This is being used by a service to decrypt 3DES content, but I need to encrypt it via Ruby. I've tried loads of scenarios with how to set the key and what to do with it, but to no avail as of yet: Tried splitting the key by , and converting each number to hex, concatenating the hex values to make the key Tried converting the number string to binary Tried converting the resulting hex to binary I assume what I need to do is something simple like: des = OpenSSL::Cipher::Cipher.new('des3') des.decrypt

Encrypting/decrypting 3DES in Ruby

社会主义新天地 提交于 2019-12-01 03:58:51
问题 I have a key.bin file which content is something along the lines of: -12, 110, 93, 14, -48, ... This is being used by a service to decrypt 3DES content, but I need to encrypt it via Ruby. I've tried loads of scenarios with how to set the key and what to do with it, but to no avail as of yet: Tried splitting the key by , and converting each number to hex, concatenating the hex values to make the key Tried converting the number string to binary Tried converting the resulting hex to binary I

3DES result in Java produces different result from 3DES iOS version

大兔子大兔子 提交于 2019-11-30 20:56:46
问题 I really really.... really need help........... -UPDATED- I need help because my java function gives me a different result compared with the iOS 3DES function. I posted the code from both ios and java; and results when specified plaintext is "tutor.1" and MD5 key is "spO13+QLZCRAe93pIXMXLg==" (MD5, clearly, is the same for both). JAVA 3DES (short and simple) public static String encrypt(String plaintext, String enctoken){ if(enctoken == null) enctoken = "sfdjf48mdfdf3054"; String encrypted =

using DES/3DES with python

Deadly 提交于 2019-11-30 12:10:49
问题 what is the best module /package in python to use des /3des for encryption /decryption. could someone provide example to encrypt data with des/3des on python. 回答1: pyDes can be used for both, DES and 3DES. Sample usage: from pyDes import * data = "Please encrypt my data" k = des("DESCRYPT", CBC, "\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_PKCS5) d = k.encrypt(data) print "Encrypted: %r" % d print "Decrypted: %r" % k.decrypt(d) assert k.decrypt(d, padmode=PAD_PKCS5) == data An alternative is the

How to use 3DES algorithm on Android?

感情迁移 提交于 2019-11-30 05:29:47
On the server side, the encyption/decryption of the password field is done in C#. Now, i need to implement same functionality in my android application. So, i followed this tutorial: http://ttux.net/post/3des-java-encrypter-des-java-encryption/ as below: import java.security.MessageDigest; import java.security.spec.KeySpec; import java.util.Arrays; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESedeKeySpec; import javax.crypto.spec.IvParameterSpec; import org.apache.commons.codec.binary.Base64; public class Encrypter

Replicate T-SQL DecryptByPassPhrase in C#

纵饮孤独 提交于 2019-11-30 03:08:17
问题 I wnat to create a C# class to decrypt a byte array encrypted using T-SQL's EncryptByPassPhrase. (Yes, I know I could decrypt within SQL Server, but what I need is to be able to encrypt/decrypt within both the database tier and in the middle tier equivalently.) I understand that SQL Server's EncryptByPassPhrase and DecryptByPassPhrase use the TripleDES symmetric key algorithm. It's not clear to me, though, what the IV should to simulate SQL Server's cryptology. I can encrypt/decrypt using the

using DES/3DES with python

做~自己de王妃 提交于 2019-11-30 02:10:11
what is the best module /package in python to use des /3des for encryption /decryption. could someone provide example to encrypt data with des/3des on python. pyDes can be used for both, DES and 3DES. Sample usage: from pyDes import * data = "Please encrypt my data" k = des("DESCRYPT", CBC, "\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_PKCS5) d = k.encrypt(data) print "Encrypted: %r" % d print "Decrypted: %r" % k.decrypt(d) assert k.decrypt(d, padmode=PAD_PKCS5) == data An alternative is the Chillkat Python Encryption Library which supports a lot of encryption algorithms (including DES & 3DES),

.NET TripleDESCryptoServiceProvider equivalent in Java

老子叫甜甜 提交于 2019-11-30 01:39:12
Please, just don't ask me why. I just have this code in .NET that encrypt/decrypt strings of data. I need now to make 'exactly' the same funcionality in java. I have tried several examples for DESede crypt, but none of them gives the same results as this class in .net. I even though on making a .net webserbvice behind ssl to serve this two methods writen in .net but it is just too stupid to do without exhausting all the posibilities. Maybe some of you java people which are more related in the area will have on top of your heads how to make it. Thanks !!! public class Encryption { private