cryptography

ProtectedData.Unprotect() fails with CryptographicException "The requested operation requires delegation to be enabled on the machine."

Calls to PortectedData.Unprotect on my development computer fail with a CryptographicException of "The requested operation requires delegation to be enabled on the machine.". The Unprotect method is being used to decrypt the initialization vector that is stored in the local registry. No other computers are used, so the Active Directory...

If MD5 is broken, what is a better solution?

Hi, After reading the topic "Is MD5 really that bad", I was thinking about a better solution for generating hashes. Are there better solutions like Adler, CRC32 or SHA1? Or are they even broken? ...

Creating a unique key based on file content in python

I got many, many files to be uploaded to the server, and I just want a way to avoid duplicates. Thus, generating a unique and small key value from a big string seemed something that a checksum was intended to do, and hashing seemed like the evolution of that. So I was going to use hash md5 to do this. But then I read somewhere that "MD...

Simple integer encryption

Is there a simple algorithm to encrypt integers? That is, a function E(i,k) that accepts an n-bit integer and a key (of any type) and produces another, unrelated n-bit integer that, when fed into a second function D(E(i),k) (along with the key) produces the original integer? Obviously there are some simple reversible operations you can...

What is the best nuclear missile crypto system?

You are on a submarine and there is an encrypted message that you want to read. Two people must use their keys at the same time in order to obtain the plain text. What is best cryptographic primitive to use? Are the following two implementations suitable? plain_text=decrypt(Key1 XOR key2,ciper_text,IV) plain_text=decrypt(Key1,decrypt...

Is SHA-1 secure for password storage?

Conclusion: SHA-1 is as safe as anything against preimage attacks, however it is easy to compute, which means it is easier to mount a bruteforce or dictionary attack. (The same is true for successors like SHA-256.) Depending on the circumstances, a hash function which was designed to be computationally expensive (such as bcrypt) might be...

Is there any available free & open source implementation of RSA-2048 for SQL Server 2000?

I'm trying to do some cryptography for SQL Server 2000, and I know that only SQL 2005+ comes with built-in functionality for doing this natively. Do you know any open source implementation that I can use for free of RSA-2048 cryptography? ...

Encrypt/ Decrypt text file in Delphi?

Hi i would like to know best encryption technique for text file encryption and ecryption. My Scenario: I have software having two type of users Administartor and Operators. Our requirement is to encrypt text file when Administrator enter data using GUI and save it. That encrypted file would be input for Operator and they just need to ...

JSF SSL Hazzard

In my application it is required that only certain pages need to be secured using SSL so i configured it security-constraint> <display-name>Security Settings</display-name> <web-resource-collection> <web-resource-name>SSL Pages</web-resource-name> <description/> <url-pattern>/*.jsp</url-pattern> <http-method>GET</http-m...

Where to store X509 certificate for Windows service?

I have a Windows service that will normally be run using the Local System Account (although in some installations it may as a specific user account). The service is using WCF, with communication secured using X509 certificates. My question is, where is the best place to store the certificate (and private key)? If using a certificate s...

How to create a RSA key in the machine for using in RSACryptoServiceProvider?

I have the following situation: Several applications in different machines are going to share a information stored in a database with RSA cryptography. Today I'm doing this in a way it's not the safer way. These machines share a DLL containing the RSA key in a XML. How could I use the information from this XML to generate machine keys...

Characteristics of an Initialization Vector

I'm by no means a cryptography expert, I have been reading a few questions around Stack Overflow and on Wikipedia but nothing is really 'clear cut' in terms of defining an IV and it's usage. Points I have discovered: An IV is pre-pended to a plaintext message in order to strengthen the encryption The IV is truely random Each message h...

What's the best way to store sensitive data in MySQL?

I'm managing the MySQL database from PHP scripts. the communication between server and client is secured via SSL. I store user account data which is sensitive. Is there a way to encrypt this data when entered into the DB? What is the best way to protect this sensitive data? EDIT: I’m using a CRON job for updating data which relies on t...

is this a correct way to generate rsa keys?

is this code going to give me correct values for RSA keys (assuming that the other functions are correct)? im having trouble getting my program to decrypt properly, as in certain blocks are not decrypting properly this is in python: import random def keygen(bits): p = q = 3 while p == q: p = random.randint(2**(bits/2-2)...

Worked Example of Digital Signature Algorithm

Hi Folks, Does anybody have a DSA worked example with simple values on how to calculate r,s and verify v == r. As this standard has been around awhile and is implemented in librarys e.g. the Java Cryptography Extension I'm finding it very hard to find an example of how the algorithm works. Compute r=(gk mod p) mod q Compute s=(k-1 * ...

Where do I find the javax.crypto source code?

Where do I find the javax.crypto source code? --update Thanks for the OpenJdk version, but what about the jdk6 version? ...

UDP security and identifying incoming data.

I have been creating an application using UDP for transmitting and receiving information. The problem I am running into is security. Right now I am using the IP/socketid in determining what data belongs to whom. However, I have been reading about how people could simply spoof their IP, then just send data as a specific IP. So this seems...

RSA key length and export limitations

I know, there are a lot of limitations to the length of used key (import and export limitations for nearly each country). Usually, it varies from 64 to 256 bits. To use more bits, it is obligatory to ask permission from authorities. But it is recommended to use 1024 bits keys for RSA as minimum! Does it mean that I cannot just use RSA w...

RSA_sign and RSACryptoProvider.VerifySignature

I'm trying to get up to speed on how to get some code that uses OpenSSL for cryptography, to play nice with another program that I'm writing in C#, using the Microsoft cryptography providers available in .NET. More to the point, I'm trying to have the C# program verify an RSA message signature generated by the OpenSSL code. The code tha...

OpenSSL signing and Google App Engine

Is there a way to sign values with a PEM formatted private key in Google App Engine (Python)? For example in PHP it could be achieved like this: $key = openssl_pkey_get_private($privateKey); openssl_sign($strToBeSigned, $signature, $key); echo "signature: ".base64_encode($signature); Is there a way to do the same thing with Python in...