cryptography

Cryptographic hash (sha1 or md5) of data given as a string in Mathematica

The sha1 hash of "abc" is a9993e364706816aba3e25717850c26c9cd0d89d The only way to get Mathematica to tell you that with its Hash function is Hash[abc, "SHA"] // IntegerString[#, 16]& (The IntegerString thing is just to output it in hex like most implementations do.) Note that Hash["abc", "SHA"] gives the hash of "\"abc\"" ...

48-bit blowfish

Is there an implementation (Java/C++/Ruby) of a blowfish algorithm that supports 48-bit data blocks? I have an encryption problem where the input and output channels are exactly 48-bits. All implementations on the net are for 64-bit blocks. Thanks, Tom ...

How can I use a key generated with sn.exe to sign a string in php?

This is another question in the line of getting C# and PHP to exchange signed pieces of data. In my scenario, I have a signed C# assembly on the client side with a public key. I also have a PHP page on the server with a private key. I want to be able to sign some data in PHP with the private key and check the signature against the public...

PKI verification across Java and Python

I am trying to implement a PKI verification scheme, where a message string is signed with a private key on server, the signature is stored on the client along with the message string. The client then verifies the signature using a public key. The restrictions of my environment are, the server is Google App Engine and the client is a Jav...

Triple DES interoperability between .Net and iPhone?

I need to encrypt a string on the iPhone and send it to a .Net for decryption using Triple DES. I am able to encrypt/decrypt on the iPhone and with .Net, but I get different results in both platforms. I use the very same code as the encryption/decryption with AES between .Net and iPhone in here The only thing that I changed .net is t...

What encryption scheme meets requirement of decimal plaintext & ciphertext and preserves length?

Hi, I need an encryption scheme where the plaintext and ciphertext are composed entirely of decimal digits. In addition, the plaintext and ciphertext must be the same length. Also the underlying encryption algorithm should be an industry-standard. I don't mind if its symmetric (e.g AES) or asymmetric (e.g RSA) - but it must be a recog...

Two CryptoStreams associated with one file in C#

I would like to create a file "myFile" that encrypts the first part using a certain key, and the last part using a certain key. So far I have something like this: cs1 = new CryptoStream(myFile, symmetricKey1.CreateEncryptor(key1, key1IV), CryptoStreamMode.Write); cs2 = new CryptoStream(myFile, symmetricKey2.CreateEncryptor(key2, key2I...

Securing private keys against brute force attacks on mobile devices

I have a mobile application where I would like to store private keys securely. The security requirement implies that it should be very hard for attackers to be able to obtain the private key even if they had unlimited access to the mobile device. In order to achieve this level of security, the application employs symmetric cryptography w...

SCrypt implementation for Java?

The original SCrypt implementation is in C. Are there any known Java ports? ...

When can you trust yourself to implement cryptography based solutions?

I've read quite a few times how I shouldn't use cryptography if I'm not an expert. Basically both Jeff and Eric tell you the same: Cryptography is difficult, better buy the security solution from experts than doing it yourself. I completely agree, for a start it's incredibly difficult to perceive all possible paths an scenario migh...

Crypto requirements and language/framework selection.

I want to build a web-based information management application for a client. The application will be used to store passwords and critical documents online. I want to know: (1) Which language/framework to go with: PHP or Ruby on Rails (RoR) or any other? (2) What type of hosting for good-security, Linux or Windows? Any other thing to b...

packaging cryptography software and distributing

I'm developing a python GUI application and plan on calling external program packaged with my program to do some encryption. I noticed from sites like OpenSSL that talk about export laws regarding cryptography software. If I can't package binary forms of the cryptography software with my application, how can I work around this to still ...

ECC Encryption with BouncyCastle for C#

After reading this post regarding the use ECC to implement the hashing using aa private key I set about trying to find an implementation of ECDH and came across BoucyCastle. Unfortunately documentation is minimal (as in zerow!) and I'm unsure what I'm about to accomplish is completely correct/valid. We want to simply hash 4 strings whi...

Can I store a PGP key ring in a csp parameters key container?

Hello, i have been using PGP. I need to safely store our PGP keyring for our application that will be processing some pgp files. Can I believe that the PGP is Asymmetric cryptography and i should be able to store the information for keyring in a key container? ...

Fiege Fiat Shamir Question about quadratic residues

Hello people I am currently studying Fiege-Fiat Shamir and am stuck on quadratic residues. I understand the concept i think but im not sure how to calculate them for example how would i calculate v | x^2 = v mod 21 | x =? ___________________________________ 1 x^2 = 1 mod 21 1, 8, 13, 20 4 x^2 = 4 mod 21 2, 5, 16 7 ...

block TEA in c#

Using block tea (XXTEA), how can I convert encrypted text into human readable form? string encryptedText = "ASDFSDAFSADFSDFSDFSDAF"; (assume it is in correct format) I have the key/pwd also. ...

NTL library in Dev-C++

Hi, I want to write a program which use NTL library under Dev-C++. Could tell me how to add NTL libraries to Dev-C++? I tried to compile (as it was said in NTL tutorial) all the files form src catalog in Dev-C++, but I got such a communicate: [Bulid Error] [Project1.exe] Error 255 That's why I cannot get ntl.a file... ...

Hashing User Passwords

I'm hashing passwords for an app I'm building using this method. I'm using the same database for development and staging while developing the app. The problem is none of the credentials work on the staging box, they work fine on my development box. Are the salt and hash values machine specific? ...

How do I generate a new public / private keypair for iPhone development?

Creating a simple public/private keypair, such as through ssh-keygen does not create a file I can import into Keychain Access. Does anyone know how to create a new keypair for iPhone development? ...

saving passwords inside your application code

Hello all, I have a doubt concerning how to store a password for usage in my application. I need to encrypt/decrypt data on the fly, so the password will need to be somewhere. Options would be to have it hard-coded in my app or load it from a file. I want to encrypt a license file for an application and one of the security steps invol...