cryptography

Implementing Recursion from psuedo-code (NTRUEncrypt)

Hello again everyone. I am required to implement the NTRU Public Key Cyptosystem as part of my final year University project. I'm trying to implement an algorithm that multiplies long polynomials via recursion, however I'm quite bogged down in trying to understand the pseudo-code. Algorithm PolyMult(c, b, a, n, N) Require: N, n, and the...

Graduation Project on Cryptography

Hi, I have to do a graduation project: Theme: Cryptography Development time: 2 months max I am looking for creative ideas :), not simple proof of concepts ;) Thanks ...

How to recover a RSA public key from a byte[] array?

Hello, I'm wondering if it's possible to recover a RSA public key that I have converted to byte array previously. byte[] keyBytes = publicKey.getEncoded(); Thanks for the help. ...

How to break up data into good sized parts

I'm writing a multi-length-output hash function, but I've hit as stumbling block: how can i break up input data in such a way that the program will not have to deal with extremely long lists or run too many loops for the given data? a = input length in bytes, a>=0 b = output length in nibbles, b>0 minimal padding is done to the data be...

Best pracices for storing secret keys

Hi I have an asp.net app, and i want to store a machine wide encryption key that i will be using in the apps, when using DPAPI crypto system. What are the best practices to store the key - where do i store it? Thanks. ...

RSA Encryption on iPhone

According the discussion on http://forums.macrumors.com/showthread.php?t=551476 the code seen below would do for RSA encryption. The datatype of the key ("public") is SecKeyRef. I will not be using the keychain, though, as I'm only interested in encryption where the key is public and is no secret. Is it even possible to use the crypto AP...

Does anyone know how to implement a secure CNG key store in C#?

Or is there a standard, default one provided in 2008? Thanks, Matt. ...

openssl versus windows capi

Which is better to use openssl or windows capi for ecnryption issues what is the pro and con list for both. and if it possible to write my encryptor program on openssl and decrypt it with windows capi with no problem or there are some problem with this. ...

using DES/3DES with python

what is the best module /package in python to use des /3des for encryption /decryption. could someone provide example to encrypt data with des/3des on python. ...

AES Encryption library

Is there a library or something that will allow me to simply call a function that will AES encrypt a byte array? I don't want to deal with multiple update blocks/transformFinal/etc, because there is a possibility I will mess up... ...

Anyone know about Jasypt (Java encryption library)?

From googling I found Jasypt, I'm wondering is it reliable? Anyone know about it? ...

How does a cryptographically secure random number generator work?

I understand how standard random number generators work. But when working with crytpography, the random numbers really have to be random. I know there are instruments that read cosmic white noise to help generate secure hashes, but your standard PC doesn't have this. How does a cryptographically secure random number generator get it...

External iPhone Cryptography Libs

Are there any legal problems using external crypto libs in my iPhone application? I know that Apple has to comply to US cryptography export rules but do I as a developer have any responsibility? How does it work? ...

Is it possible to get identical SHA1 hash?

Given two different strings S1 and S2 (S1 != S2) is it possible that: SHA1(S1) == SHA1(S2) is True? If yes - with what probability? If not - why not? Is there a upper bound on the length of a input string, for which probably of getting duplicates is 0? OR is the calculation of SHA1 (hence probability of duplicates) independent o...

Import .pem public and private keys to JKS keystore

Hi, I have public and private keys in separate .pem files that I would need to get into a JKS keystore somehow. Tried using the -import command in KeyTool for this, which gives an "not an X.509 certificate" error. I'm guessing the solution has to do with OpenSSL, but I'm not entirely sure what to do with it. Would really appreciate a...

Hiding a value in an Android application

Hi, I need to hide a value in a mobile (Android OS) application. As far as I can see, encrypting the value is of no use as the key to the encryption mechanism must be available to the program and is thus available to an attacker reverse-engineering the code. So, it seems that the only "solution" is to hide the secret value in the applic...

How to reproduce System.Security.Cryptography.SHA1Managed result in Python

Here's the deal: I'm moving a .NET website to Python. I have a database with passwords hashed using the System.Security.Cryptography.SHA1Managed utility. I'm creating the hash in .NET with the following code: string hashedPassword = Cryptographer.CreateHash("MYHasher", userInfo.Password); The MYHasher block looks like this: <add al...

Optimizing encrypted column search

I have a table called,tblClient with an encrypted column called SSN. Due to company policy, we encrypted SSN using a symmetric key (chosen over asymmetric key due to performance reasons) using a password. Here is a partial LIKE search on SSN declare @SSN varchar(11) set @SSN = '111-22-%' open symmetric key SSN_KEY decrypt by p...

Programming a VPN, Authontication stage - RFC not clear enough

I have a custom build of a Unix OS. My task: Adding an IPSec to the OS. I am working on Phase I, done sending the first 2 packets. What I am trying to do now is making the Identification Payload. I've been reading RFC 2409 (Apendix B) which discuss the keying materials (SKEYID, SKEYID_d, SKEYID_a, SKEYID_e and the IV making). Now, I ...

Using one key for Encryption and HMAC

Hello, I am wondering whether I can use a shared secret key established between two clients as the HMAC key too. I saw that there is a problem when it is used as a CBC-MAC but I haven't found any evidence it is bad practice for HMACs. Thanks, Vladimir ...