des

Time to crack DES? Is it a task suitable for a script kiddie yet?

我的梦境 提交于 2019-12-07 00:28:42
问题 Already understanding that AES is the encryption method of choice, should existing code that uses DES be re-written if the likely threat is on the level of script kiddies? (e.g. pkzip passwords can be cracked with free utilities by non-computer professionals, so is DES like that?) A quick google search seems to imply that even deprecated DES still requires a super computer and large quantity of time--or have times changed? In particular, this CAPTCHA library uses DES to encrypt the challenge

encryption using provided key using DES with padding

让人想犯罪 __ 提交于 2019-12-06 15:53:58
问题 I want to encrypt a frame using DES using a given key. The padding style I am using is PKCS5Padding. This pads the string with 02 02 if 2 bytes are to be added and with 03 03 03 if 3 bytes are to be added to make multiple of 8. But my requirement is to pad a string with my particular bytes. e.g if 2 bytes are to be added then 30 30 and 3 bytes are to be added then 30 30 30 (in hex 0's value is 30). Also, I must know how many padded bytes have been added. Which padding technique should I

Java Triple DES encryption with 2 different keys

六月ゝ 毕业季﹏ 提交于 2019-12-06 15:24:56
问题 I'm trying to encrypt data using triple DES with two different keys, so given the two keys k1 and k2 the cryptotext would be Ek1(Dk2(Ek1(plaintext))) where E is Encryption and D Decryption. I'm trying to simulate this using DES algorithm from java. Here is the code: public static void main(String[] args) { SecretKey k1 = generateDESkey(); SecretKey k2 = generateDESkey(); String firstEncryption = desEncryption("plaintext", k1); String decryption = desDecryption(firstEncryption, k2); String

Encrypt complete object with triple des

旧街凉风 提交于 2019-12-06 15:18:01
问题 I need to encrypt a complete java object. I am having a code which i have seen on internet which shows how to encrypt and decrypt text not the java object. So i was confused whether this is possible to encrypt complete java object. The code which i am using is below. package security; import java.security.spec.KeySpec; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESedeKeySpec; import sun.misc.BASE64Decoder; import

JAVA实现对称加密

六月ゝ 毕业季﹏ 提交于 2019-12-06 10:52:50
一、对称加密算法DES 1、概述:采用单钥 密码系统 的加密方法,同一个 密钥 可以同时用作信息的加密和解密,这种加密方法称为 对称加密,也称为单 密钥加密 。 对称加密的 特点 : 即 加密密钥 = 解密密钥 2、常用的对称加密算法: 初等 DES —3DES AES PBE IDEA 3、对称加密算法 —— DES DES( Data Encryption Standard ) 是一种 数据加密标准 。 其密钥规则如下: ​ 4、JDK实现DES算法 【1】初始化密钥 使用KeyGenerator类的getInstance()静态方法,获取生成指定算法的密钥生成器,参数是算法名称. 使用KeyGenerator类的init()方法进行密钥生成器的初始化,指定密钥生成器产生密钥的长度. 使用KeyGenerator类的generatorKey()方法生成一个密钥对象,返回SecretKey密钥对象. SecretKey为密钥对象.使用它的getEncoded()方法返回一个密钥(字节数组形式) 【2】转化密钥(还原密钥) 将jdk生成的密钥对象转化成DES规则的密钥对象. 创建一个DESKeySpec实例,作用是将JDK初始化的密钥转化成DES规则的密钥. 构造方法参数是JDK生成的密钥(字节数组形式). 使用SecretKeyFactory类的getInstance(

How should I create my DES key? Why is an 7-character string not enough?

送分小仙女□ 提交于 2019-12-06 05:02:39
问题 I'm having a bit of difficulty getting an understand of key length requirements in cryptography. I'm currently using DES which I believe is 56 bits... now, by converting an 8 character password to a byte[] my cryptography works. If I use a 7 digit password, it doesn't. Now, forgive me if I'm wrong, but is that because ASCII characters are 7 bits, therefor 8 * 7 = 56bits? That just doesn't seem right to me. If I want to use a key, why can I not just pass in a salted hash of my secret key, i.e.

PyDES with Bloomberg data

帅比萌擦擦* 提交于 2019-12-06 04:37:30
I am trying to decrypt DES encoded Bloomberg financial data with PyDES. The file ends in gz.enc, I am able to read the file to a binary, reload the binary back in to a variable (the variable has data) and then use the following decryption on it. k = pyDes.des(password, pyDes.ECB, padmode=pyDes.PAD_PKCS5) released = k.decrypt(encrypted_data) The problem is I get an empty string for 'released'. I unfortunately cannot share the file nor the password due to privacy laws. I cannot use the bloomberg decryption as they do not support Ubuntu nor Mac. 来源: https://stackoverflow.com/questions/41398026

Convert char or string to bitset in c++

岁酱吖の 提交于 2019-12-06 04:28:15
问题 I'm doing an assignment on DES encryption and I can't seem to convert a string, let alone a char into a bitset. Can anyone show me how to convert a single char into a bitset in C++? 回答1: The following: char c = 'A'; std::bitset<8> b(c); // implicit cast to unsigned long long should work. See http://ideone.com/PtSFvz Converting an arbitrary-length string to a bitset is harder, if at all possible. The size of a bitset must be known at compile-time, so there's not really a way of converting a

Triple DES encryption

柔情痞子 提交于 2019-12-06 03:45:37
问题 Please note that the issue I am having here is with the key size . At first, based on the comments included in the below code, I figured that my key needed to be 24 bytes (192 bits). This didn't work so I gave 16, 32, and 8 byte keys a shot - nothing seems to be working. By "not working" I mean that after my text has been encrypted and decrypted it does not hold the same value as my original text. Example: Original Text: 'Example test this should work ' Encrypted Text: ¸ ¹pÕô6 Decrypted Text:

Why does checking if a HashMap has a certain value take very long to execute within a for loop?

旧时模样 提交于 2019-12-05 15:59:03
I am working with meet-in-the-middle attack on Double-DES. I have implemented the DES encryption/decryption and done the encryptions and now I would like to perform a MITM attack on the Double-DES in order to find the keys. The way I am trying to achieve this is by storing, within a for loop, the intermediate ciphers as the key of a HashMap and the possible keys as the values of the HashMap. However, within this for loop I also want to make sure that the possible keys are unique i.e. I have an if statement, which checks whether the possible key already exists in the HashMap. If not, then it