cryptography

Thread Safety of .NET Encryption Classes?

I have a high-level goal of creating a static utility class that encapsulates the encryption for my .NET application. Inside I'd like to minimize the object creations that aren't necessary. My question is: what is the thread-safety of the classes which implement symmetric encryption within the .NET Framework? Specifically System.Secur...

how to define a crypto library for xmlsec..

I want to write XML signature verification code in C using any available open source libraries.I am trying to use xmlsec. I installed the dependency libraries mentioned in http://www.zlatkovic.com/libxml.en.html. but when I try to compile the example code given in http://www.aleksey.com/xmlsec/api/xmlsec-notes-verify-x509.html , I am get...

How do I pre-determine the length of the resultant cipher text produced in an encryption operation?

Hi all, I have an application which stores some information in an encrypted state, both on file and in a database. How can I calculate what the length of the resultant cipher text will be based on the plain text input? The encryption operation consists of using the .NET RijndaelManaged class/algorithm and then a conversion to a Base64...

Java 256bit AES Encryption

I need to implement 256 bit AES encryption, but all the examples I have found online use a "KeyGenerator" to generate a 256 bit key, but I would like to use my own passkey. How can I create my own key? I have tried padding it out to 256 bits, but then I get an error saying that the key is too long. I do have the unlimited jurisdiction pa...

Determining Letter Frequency Of Cipher Text In Python

I am trying to make a tool that finds the frequencies of letters in some type of cipher text. Lets suppose it is all lowercase a-z no numbers. The encoded message is in a txt file I am trying to build a script to help in cracking of substitution or possibly transposition ciphers. Code so far cipher = open('cipher.txt','U').read() cip...

How to compile the Botan crypto library as a static lib in VC++?

I've been extremely unsuccessful in compiling Botan as a static library in Visual C++. The build.h file contains the following code: #ifndef BOTAN_DLL #define BOTAN_DLL __declspec(dllexport) #endif This macro then shows up pretty much everywhere in the Botan codebase, like this: class BOTAN_DLL AutoSeeded_RNG : public RandomNumberG...

Issue certificate for a PKCS#10 CSR without Cert template. 0x80094801 MS W2K3 enterprise CA

Hello, We have a MS Enterprise 2003 CA. I am trying to issue a certificate for a PKCS#10 CSR which is generated without a certificate template. I am getting the following error The request contains no certificate template information. 0x80094801 (-2146875391) Denied by Policy Module 0x80094801, The request doesnot contain a c...

Reinstalling iPhone code signing certificates after new Leopard install.

Back story: Small-time iPhone developer, even have a (tiny) app on the App Store, so I've navigated the code-signing process before. Performed the appropriate backups of my crypto certs (as outlined in the "Saving your Private Key and Transferring to other Systems" section of iPhone Developer Program Standard Program Portal User Guid...

An algorithm for distributed or decentralised reputation/trust

Does anyone know of an algorithm for computing how much you 'trust' another user (their reputation) in a decentralised system. Sites like this one use a centralised authority to track reputation points, but when you can't trust an authority to maintain this list impartially, or the infrastructure doesn't exist, how can you rank your pee...

Secure data on server

Hi, I am setting up a server where some important code will reside. I want to make sure the code is unreachable, in case the HD is stolen. Well I know you never can be sure, but reasonably secure. Which method could I use? How to i.e. mount a crypted filesystem at bootup without human interaction? Thank you very much for your help. ...

Using Java crypto leads to NoSuchAlgorithmException

Here's the encryption portion of my code. It compiles fine but fails with that exception at runtime: import java.util.Random; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; ... byte[] salt = new byte[8]; Ra...

array<Byte>^ TO unsigned char* :: Marshall class - Interop Issue

Hi, I wanted to convert array< Byte>^ to unsigned char*. I have tried to explain what i have done. I donot know how to proceed further. Please show me the right approach. I am using MS VC 2005. //Managed array array<Byte>^ vPublicKey = vX509->GetPublicKey(); //Unmanaged array unsigned char vUnmanagedPublicKey[MAX_PUBLIC_KE...

What exactly is a rainbow attack?

I was reading a few articles on salts and password hashes and a few people were mentioning rainbow attacks. What exactly is a rainbow attack and what are the best methods to prevent it? ...

Practical applications of homomorphic encryption algorithms?

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...

Transferring cryptographic initialization vectors

I want to know the best way of transferring a cryptographic initialization vector (IV) from the place where my data is encrypted to the place where my data is decrypted. In other words, the IV should be randomly generated every time you encrypt a message (right?), so there needs to be some way of finding the IV when you decrypt. I have...

MD4 implementation in C -- consistent, yet erroneous output

I can't seem to get my md4 implementation working. Any ideas as to what's wrong? Also, I'm not in the class that this project was assigned to.. I'm just doing it for kicks. I would also rather you give me hints than an outright answer. Thanks! EDIT: To be specific (as I know to be), my outputs do not match the test vectors provided ...

X509 - Toolkit/API - C/C++ Certificate Management

Hello I am looking to identify a third party API which will perform certificate management using c/c++; Ideally, the API should perform the following, Generate CSR's Perform Certificate conversions(pem<>DER) Retrieves certificates from CA's Parsing X509 certificates to extract various fields like public key, subject name, i...

Digitally Sign Parts of a XML document

I have an XML document having structure similar to the following <envelop> <header>blaa</header> <message>blaa blaa</message> <footer></footer> </envelop> I want to digitally sign the header and message elements and add the signature to the footer element. How can I sign the elements and then later verify the signature (...

MySQL MD5 and Java MD5 not equal

The next function in MySQL MD5( 'secret' ) generates 5ebe2294ecd0e0f08eab7690d2a6ee69 I would like to have a Java function to generate the same output. But public static String md5( String source ) { try { MessageDigest md = MessageDigest.getInstance( "MD5" ); byte[] bytes = md.digest( source.getBytes("UTF-8") ); ...

Help me better understand cryptographic hash functions

I was reading this question on MD5 hash values and the accepted answer confuses me. One of the main properties, as I understand it, of a cryptopgraphic hash function is that it is infeasible to find two different messages (inputs) with the same hash value. Yet the consensus answer to the question "why aren't MD5 hash values reversibl...