cryptography

Quantum Computing and Encryption Breaking

旧城冷巷雨未停 提交于 2019-12-20 08:11:06
问题 I read a while back that Quantum Computers can break most types of hashing and encryption in use today in a very short amount of time(I believe it was mere minutes). How is it possible? I've tried reading articles about it but I get lost at the a quantum bit can be 1, 0, or something else . Can someone explain how this relates to cracking such algorithms in plain English without all the fancy maths? 回答1: Preamble: Quantum computers are strange beasts that we really haven't yet tamed to the

Practical applications of homomorphic encryption algorithms?

给你一囗甜甜゛ 提交于 2019-12-20 08:04:28
问题 It appears there there were interesting things going on in cryptography: the first homomorphic encryption scheme appeared recently (explanation, HT). Roughly speaking, it is a way of encoding x into f(x) such that you can compute f(x+y) easily knowing f(x) and f(y) even though you can't easily restore x and y (and same for f(x*y) ). What are practical applications for schemes of this type (once their security has been established)? To me, it appears they could make writing algorithms for

Practical applications of homomorphic encryption algorithms?

邮差的信 提交于 2019-12-20 08:04:25
问题 It appears there there were interesting things going on in cryptography: the first homomorphic encryption scheme appeared recently (explanation, HT). Roughly speaking, it is a way of encoding x into f(x) such that you can compute f(x+y) easily knowing f(x) and f(y) even though you can't easily restore x and y (and same for f(x*y) ). What are practical applications for schemes of this type (once their security has been established)? To me, it appears they could make writing algorithms for

Problems when using AES crypto between Node and CryptoJS in browser

我的未来我决定 提交于 2019-12-20 05:45:23
问题 I want encrypt a string with Node, and decrypt the string with CryptoJS in browser. Encrypt: var crypto = require('crypto'); function encrypt(txt, cryptkey) { var cipher = crypto.createCipher('aes-256-cbc', cryptkey); var crypted = cipher.update(txt, 'utf8', 'hex'); crypted += cipher.final('hex'); return crypted; } encrypt('1', 'key'); // 83684beb6c8cf063caf45cb7fad04a50 Include: <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script> Decrypt: var decrypted

Websafe encoding of hashed string in nodejs

我是研究僧i 提交于 2019-12-20 05:12:15
问题 I am creating a re-director of sorts in nodejs. I have a few values like userid // superid these I would like to hash to prevent users from retrieving the url and faking someone else's url and also base64 encode to minimize the length of the url created. http://myurl.com/~hashedtoken where un-hashed hashtoken could be something like this 55q322q23 55 = userid I thought about using crypto library like so: crypto.createHash('md5').update("55q322q23").digest("base64"); which returns: u

What data type to use when storing PBKDF2 encrypted passwords?

夙愿已清 提交于 2019-12-20 04:55:53
问题 I am using SimpleCrypto.Net to encrypt my passwords, which i understands uses PBKDF2 and a specified salt and number of iterations. I would like to know what's the most appropriate data type for me to set the password column to in the database. 回答1: From looking at the code the result is a base64 encoded key of 64 bytes. Considering base64 is made up of ASCII characters I would recommend storing it as CHAR(88) or to be on the safe side you could go with VARCHAR(MAX) . However, as the key size

openssl is acting open to any size key

谁都会走 提交于 2019-12-20 04:20:52
问题 how does openssl works with key as it is taking any size of key (1 byte to any size). What is the procedure to go to actual key here .. openssl enc -d -des-ecb -in cipher.txt -out text.out -K '530343412312345445123345677812345678812324' 回答1: how does openssl works with key ... What is the procedure... It depends on the program, but procedures are usually consistent across the library. In you example, you are using the openssl dec , so you are using the dec sub-program. The source code is

How to get AES secret key from DH secret key

这一生的挚爱 提交于 2019-12-20 04:15:22
问题 I have the following code that converts a DH secret key to AES secret key. This used to work until Oracle JRE 8u161 when they started restricting creation of DH keys < 1024 in java.security file. Now, I will get NoSuchAlgorithmException: Unsupported secret key algorithm AES at the last line. PrivateKey privKey = null; PublicKey pubKey = null; PublicKey agreement = null; KeyAgreement keyAgreement = KeyAgreement.getInstance("DH"); keyAgreement.init(privKey); keyAgreement.doPhase(pubKey, false);

How can I encrypt/decrypt data using AES CBC+CTS (ciphertext stealing) mode in PHP?

大兔子大兔子 提交于 2019-12-20 03:27:29
问题 I have to encrypt and decrypt data in AES CTS mode (ciphertext stealing, sometimes referred as AES-XTS) in PHP to interoperate with a remote system written in .NET platform. In .NET 4, this mode is supported natively. For PHP, I cannot find a solution, based on the manual, mcrypt does not seem to have support for this mode. Could anyone please explain the difference between plain CBC and CBC-CTS? Is it possible to make the latter work in PHP with using existing modules/libraries? 回答1: This is

generate HMAC-SHA1 in C#

心已入冬 提交于 2019-12-20 03:14:56
问题 I am trying to make use of a REST API using C#. The API creator has provided below pseudo code for hmac creation. var key1 = sha1(body); var key2 = key1 . SECRET_KEY; var key3 = sha1(key2); var signature = base64_encode(key3); In the above pseudo code , body is html request body string , and SECRET_KEY is the secret key provided by REST API provider. As per my knowledge , I need to use System.Security.Cryptography.HMACSHA1 class to implement this. But am not able to completely implement above