cryptography

Qt Computing and Comparing Password Hashs

£可爱£侵袭症+ 提交于 2021-02-04 21:45:00
问题 Currently building a web facing authentication service in Qt for a Quiz program. It is my understanding that when storing a users password in a database it must be obscured in case it falls into the wrong hands. The prevailing method appears to be a process of adding Salt to the password and then storing the computed hash of the combination. This hash can later be compared : HASH( userinput + SALT ) = StoredHash Qt provides QCryptographicHash::hash( data, Algorithm method) but as the key is

Qt Computing and Comparing Password Hashs

China☆狼群 提交于 2021-02-04 21:44:32
问题 Currently building a web facing authentication service in Qt for a Quiz program. It is my understanding that when storing a users password in a database it must be obscured in case it falls into the wrong hands. The prevailing method appears to be a process of adding Salt to the password and then storing the computed hash of the combination. This hash can later be compared : HASH( userinput + SALT ) = StoredHash Qt provides QCryptographicHash::hash( data, Algorithm method) but as the key is

How to store Session ID securely

我们两清 提交于 2021-02-02 09:06:29
问题 I am a student learning about cryptography. After searching online, I am still unable to find an answer to my question. I am wondering how to store a session ID securely for an ecommerce website. If it is possible, how so? Please do explain it in Layman's term. Looking forward to your helpful answers. Cheers 回答1: Session IDs are usually just a random (opaque) identifier that is passed between the client and the server. The server uses the identifier to look up state information (e.g. current

公钥密码的三大数学问题

谁说我不能喝 提交于 2021-01-31 14:23:55
公钥密码体制又称公开密钥密码体系,公钥密码体制是现代密码学的最重要的发明和进展,在1976年,Whitfield Diffie和Martin Hellman发表了“New directions in cryptography”这篇划时代的文章奠定了公钥密码系统的基础。 公钥密码体制根据其所依据的难题一般分为三类:大素数分解问题类、 离散对数 问题类、椭圆曲线类。 1:大数因子分解 具体说明: Ⅰ)给定两个素数p,q,计算乘积p·q=n很容易; Ⅱ)给定大整数n,求n的素因素p,q使得n=p·q非常困难. 大数因子分解是国际数学界几百年来尚未解决的难题,也是现代密码学中公开密钥RSA算法密码体制建立的基础。《大数因子分解的合数模式特性》从RSA算法存在的不动点中发现了素数因子的分布与特性以及它们之间的连接机制,据此将大数因子分解问题转化为在两个含有素数因子的数之间求公因子问题,将最困难的大数因子分解问题转化为一系列算法的初等数学问题,这无疑是研究大数因子分解的重要成果与进展。 2:离散对数 已知有限循环群G={g∧k∣k=0,1,2,...}及其生成元g和阶n=∣G∣. Ⅰ)给定整数a,计算元素g∧a=h很容易; Ⅱ)给定元素h,计算整数x,0≤x≤n,使得g∧x=h非常困难,其难度与RSA中因子分解素数之积的难度有相同的数量级。 3:椭圆曲线 已知有限域F_p上的椭圆曲线点群 E

BLAKE2 input parameters

◇◆丶佛笑我妖孽 提交于 2021-01-29 08:22:09
问题 Being a newbie, I was reading papers on the recent crop of hash functions and BLAKE2 intrigued me. Then I wanted to play around with the "blake2s" code in the code package. If I were to implement a simple string hasher, I could understand that there are built-in variables for a key and salt. But I couldn't figure out how to provide a string or file as input and collect the hash as input. Which variable(s) are responsible for the message and the digest? Maybe I'm doing things wrong but the

Decrypting MD5 hashed text when salt is known

别说谁变了你拦得住时间么 提交于 2021-01-29 07:23:04
问题 Let's say I have the following MD5 hashed password: bec0932119f0b0dd192c3bb5e5984eec If I know that the original password was salted and hashed and know that instead of typical salt it was just wrapped in 'flag{}' before MD5 summing it. How may I decrypt MD5 in this case? 回答1: The other answer is not correct in the definition of what you are trying. Let's begin with the formal definitions of Cryptographical hash functions' required resistances. The below from Cryptographic Hash-Function

Why use CryptoStream instead of TransformBlock?

落花浮王杯 提交于 2021-01-29 06:34:41
问题 Docs never really mention why CryptoStream should be used instead of TransformBlock and TransformFinalBlock other than that it calls whichever is needed automatically. Thus, why would one use the code in this answer (https://stackoverflow.com/a/2006922/7343355) instead of this: using (var encryptor = aes.CreateEncryptor()) { result = encryptor.TransformFinalBlock(data, 0, data.Length); // Data length is greater than the blocksize } Even though TransformFinalBlock should be used after

Why use CryptoStream instead of TransformBlock?

大兔子大兔子 提交于 2021-01-29 06:21:08
问题 Docs never really mention why CryptoStream should be used instead of TransformBlock and TransformFinalBlock other than that it calls whichever is needed automatically. Thus, why would one use the code in this answer (https://stackoverflow.com/a/2006922/7343355) instead of this: using (var encryptor = aes.CreateEncryptor()) { result = encryptor.TransformFinalBlock(data, 0, data.Length); // Data length is greater than the blocksize } Even though TransformFinalBlock should be used after

What is missing from the AES Validation Standard Pseudocode for the Monte Carlo Tests?

痞子三分冷 提交于 2021-01-29 05:23:59
问题 I'm trying to use the prescribed validation procedure for AES-128 in CBC mode, as defined in the NIST AESAVS standard. One of the more important parts of the test suite is the Monte Carlo test, which provides an algorithm for generating many 10000 pseudorandom tests cases such that it is unlikely that a hardcoded circuit could fake AES. The algorithm pseudocode therein appears to be taking some liberties with variable scope and definition, so I am hoping someone could help me fill in the

Program to crack Caesar cipher

前提是你 提交于 2021-01-29 00:16:43
问题 The Caesar cipher basically shifts each letter of plaintext by a fixed number. For example, if the key 2 is used, the word Sourpuss would be encoded Uqwrtrwuu The text can contain only the printable ASCII characters (32-126, for our purposes). Implement an algorithm for cracking this code. I need to decrypt this: "T! x$r&'}r&z! %21j!'1~zxy&1"r%%1TZedBEAB?" Here is my code: def decoded(s): for i in range(1,95): string = "" for char in s: if(ord(char) + i > 126): charc = (ord(char) + i) - 94