cryptography

Return value of XXTEA

This may seem a stupid question but I can't find the anwer... This is the code for XXTEA from Wikipedia: #include <stdint.h> #define DELTA 0x9e3779b9 #define MX ((z>>5^y<<2) + (y>>3^z<<4)) ^ ((sum^y) + (k[(p&3)^e] ^ z)); void btea(uint32_t *v, int n, uint32_t const k[4]) { uint32_t y, z, sum; unsigned p, rounds, e; if (n > 1) { ...

"Signed" email in PHP

How would one "sign" an outgoing email using PHP? The proper header I am looking at is: signed-by mydomain.com ...

Cryptographic failure while signing assembly '<assemblyname>.dll' – 'Bad Version of Provider'

I purchased an authenticode certificate from a well known provider. Now I want to strong name an assembly and later on digitally sign it. This is what I've done so far: Extracted public key from pfx by running sn.exe -p keypair.pfx key.snk Checked both "Sign the assembly" and "Delay sign only" checkboxes on project properties signing...

Public Overrides Function GetBytes() As Byte() is obsolete

What does the poet try to say? Public Overrides Function GetBytes() As Byte() is obsolete: Rfc2898DeriveBytes replaces PasswordDeriveBytes for deriving key material from a password and is preferred in new applications. Should i replace this one... Dim keyBytes As Byte() keyBytes = password.GetBytes(keySize / 8) ...with what? ...

Secret computing: does such an animal exist?

A question in theory of Computer Science Today I can secretly store files in the cloud (say, amazon s3), by having them encrypted before I store them and decrypt them after I download. The storage provider cannot obtain any information from the stored files - everything is encrypted safely, and even symmetrical cipher will be ok here. ...

Decrypting PKCS#7 encrypted data in C#

I am working on a solution that needs to decrypt PKCS#7 encrypted data, preferably in C#. As far as I can see, the .NET api has support for this through the System.Security.Cryptography.Pkcs namespace. However it seems that the implementation can only work on byte arrays. So what do I do when I have a large encrypted file that does not f...

How to encrypt/decrypt text from file with php?

How to encrypt/decrypt text from file with php? ...

CryptographicException on Decryption

Hi All, Just wanna confirm my thoughts about CryptographicException on decryption. I have some tests, exactly the one with wrong passphraze. This test throws System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. I was looking what would cause this. However I could not find anything. It leads ...

Which is the standard Java crypto API?

Hi, I want to implement a tool in Java to learn more about cryptography. I know that there is a security package with some crypto stuff inside. Now I saw there is a dedicated javax.crypto package inside the SDK. Where is the difference? Are they both up to date? I wanted to start my tool with some historical ciphers. But it should n...

Secure Remote Password Implementation for iPhone

I've been reading about Stanford's Secure Remote Password protocol, and it looks ideal for the sort of environment in which iPhone apps run. Unfortunately, I haven't been able to find a good Objective-C implementation of the protocol. Nor, as far as I can tell, do the crypto libraries in the SDK implement it. Does anyone know of such an...

cryptoapi windows 7 support

Hello Microsoft has introduced cryptography next generation (CNG) from Vista and server 2008 onwards. But my question is to know whether microsoft supports the old cryptoAPI(say for eg. in windows 2003 and windows xp, - crypt32.dll) in windows 7 and server 2008. Thanks Raj ...

Wincrypt: Unable to decrypt file which was encrypted in C#. NTE_BAD_DATA at CryptDecrypt

I am trying to decrypt a piece of a file with wincrypt and I cannot seem to make this function decrypt correctly. The bytes are encrypted with the RC2 implementation in C# and I am supplying the same password and IV to both the encryption and decryption process (encrypted in C#, decrypted in c++). All of my functions along the way are ...

Signing data in C++ compatible with PHP's openssl library

I'm looking for a way to sign some data in C++ code which will then be sent to a PHP script for verification and processing. I want to use the OpenSSL module there, namely the *openssl_verify* function so I need something compatible with that. The application will be only for Windows so CryptoAPI might be fine but looking at the samples...

How do you generate cryptographically secure random numbers with PHP?

We need to generate a cryptographically random string to use as an authentication token, which will be tied to session data in the database. We are using PHP, which doesn't appear to have a suitable random number generator built-in. How can we generate a cryptographically secure random string of N length using php? Also note, due to t...

JavaScript based cryptographic signing?

I am dealing with a particularly paranoid group of users who might want their contributions to my web site to be signed (e.g. with a GPG key) before submitting. While I could show them a "snippet" to copy and paste into their GPG tool, having the browser do this would certainly be nicer. With the JS performance of recent browsers, I'm ...

MD5 hashing in Python

Is there any way to decrypt the encrypted MD5 string, given the key? ...

How to make a message into a polynomial?

I'm doing a project where I have to implement the NTRUEncrypt public key cryptosystem. This is the first step according to their guide in encrypting - "Alice, who wants to send a secret message to Bob, puts her message in the form of a polynomial m with coefficients {-1,0,1}" . I want to know how I can make my message into a polynomial. ...

How to prove inconstructable cryptographic scheme?

Hi, I realize this question might not be that programming related, and that it by many will sound like a silly question due to the intuitive logical fault of this idéa. My question is: is it provable impossible to construct a cryptographic scheme (implementable with a turing-complete programming language) where the encrypted data can...

Using Win32 Crypto API

I can't find any help to implement PROV_RSA_AES CSP in c++. is there any article or book to help me out with it? ...

Performance of RSA based on keysize

Hi, A theoretical question not depending on implementation, how much of a decrease in performance is 1024bit vs 4096bit RSA? Thanks ...