encryption

jQuery having trouble selecting things in different cases

Note: If you're 'just' a jQuery developer some things in this post may look a tad complex (Base62 encoding etc.) - it's really not. Although the more technical details are relevant to the question, the core is that jQuery won't select stuff with capitals. Thanks! Hi folks! So I have a list generated by Ajax. When you click the list's t...

CryptographicException intermittently occurs when encrypting/decrypting with RSA

I'm trying to encrypt and decrypt data using RSA in C#. I have the following MSTest unit test: const string rawPassword = "mypass"; // Encrypt string publicKey, privateKey; string encryptedPassword = RSAUtils.Encrypt(rawPassword, out publicKey, out privateKey); Assert.AreNotEqual(rawPassword, encryptedPassword, "Raw password and e...

How to make TLS connection from PHP in web server, and safely

Suppose I have some PHP code running inside a web server, for example, running a simple CakePHP app. From this app, I want to occasionally make a TLS connection out to some server to exchange some data. How is this typically done? (I have little experience with PHP.) What PHP plug-ins or libraries or whatever, are recommended to accompl...

Can a deterministic hashing function be easily decrypted?

Possible Duplicates: Is it possible to decrypt md5 hashes? Is it possible to reverse a sha1? i asked this question: http://stackoverflow.com/questions/3143693/working-with-huge-spreadsheet and got a great answer and i followed the advice. i used this: http://splinter.com.au/blog/?p=86 and i hashed about 300,000 different e...

Storing encrypted personal information - common sense?

Hi everybody, We're in the middle of developing a e-commerce application that will be used by our customers on a pay-monthly-plan. We have thought a bit about offering encryption of all personal data that is stored in the database, to make our application a notch safer to the final consumers. The encryption would be handled completely ...

Verifying that something has been "done" through hashes/encryption

So, to start off, I want to point out that I know that these things are never fool-proof and if enough effort is applied anything can be broken. But: Say I hand a piece of software to someone (that I have written) and get them to run it. I want to verify the result that they get. I was thinking of using some sort of encryption/hash tha...

Does sha-1 ever produce collisions for input messages less than 160bits?

I have a 128bit ID that I want to perform a one way hash on, but I don't want to ever get the same digest for an input message. Does anyone know if sha-1, or an alternative, is guaranteed not to produce collisions for the set of messages less than its output digest size? This is at least theoretically possible... I also considered using...

Best secure data transmission method?

I'm attempting to set up a small network of computers where 4 child nodes feed small snippets of data into 1 parent node. I need the data transmission between the nodes to be secure (secure as in, if the packets are intercepted it is not easy to determine their contents). Does anyone have suggestions? I looked into HTTPS POST and encrypt...

Storing Application Sensitive Data

Hi everybody, I am implementing a python application that will connect to our different servers and computers. They all have different logins and passwords. I want to store all these information in the app directly and ask for one master login/password only. How can I store all these sensitive data in the application so that someone who...

Getting IllegalBlockSize when trying to encrypt too much data

Here are my constants //Encryption fields /** Algorithm=RSA Mode=ECB Padding=PKCS1Padding*/ public static final String ALGORITHM_MODE_PADDING = "RSA/ECB/PKCS1Padding"; /** Algorithm=RSA */ public static final String ALGORITHM = "RSA"; /** Provider=BouncyCastle */ public static final String PROVIDER = "BC"; /** Key size for the public an...

Most Effective Public Key Encryption Method

There seems to be a lot of hype about asymmetric Public Key encryption. RSA, PGP... etc. You have a set of two keys and distribute one, so that either only you can encrypt the message or only you can decrypt the message. One method provides a way to verify the sender, while the other provides a way to secure the message. (Feel free to co...

Recommended Encryption combination for digital signatures

Hi I have finally - after days and days of agony - figured out that I need two forms of encryption for my Digital Signatures Project. The first will will be symmetric (AES) and will encrypt the license data and the second will be a asymmetric (RSA) an will encrypt the symmetric key. Can someone give me pointers on the best methods to ...

PublicKey vs RSAPublicKeySpec

When I create an RSA keypair should I be be doing KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); kpg.initialize(2048); KeyPair kp = kpg.genKeyPair(); PublicKey publicKey = kp.getPublic(); PrivateKey privateKey = kp.getPrivate(); save("public.key",publicKey.getEncoded()) save("private.key",privateKey.getEncoded()) OR Key...

How to transfer pgp private&public key to another computer?

I read this article which explained very well how to setup pgp on osx, but I'm planning to use the generated keys for signing git commits, so I figure I need to transfer the keys to my other computer. Is this correct? and if so how do I go about transferring the keys? ...

Java implementation of crypt(3)?

Hello, Could someone point me in the direction of a crypt(3) library for java? One that generates results similar to PHP. e.g. james => $1$uAjE75CY$XVIp.DpCuwQTG60h.r5er/ Thanks Update: The password above is separated by $. The 1 represents MD5 (variation). The next token represents the salt used for the hash and the last token repr...

HSM - cryptoki - Sessions - Timeout

My application access the HSM via a ASP.NET web service through PKCS#11. I initialise the cryptoki library and obtain a session handle. Web-service hold on to this handle to perform encryption/decryption/signing/verifying in a batch mode. The problem i am facing is The ASP.NET web service time-outs' after 20 minutes. This act- i think, ...

Getting 'BadPaddingException: pad block corrupted' in AES/CBC/PKCS5Padding

My constants public static final String AES_ALGORITHM_MODE_PADDING = "AES/CBC/PKCS5Padding"; public static final String AES = "AES"; public static final String PROVIDER = "BC"; Encryption Cipher aesCipher = Cipher.getInstance(AES_ALGORITHM_MODE_PADDING, PROVIDER); SecretKeySpec aeskeySpec = new SecretKeySpec(rawAesKey, AES);...

Decrypt an ecrypted String using QCA

Based on QCA::Cipher Example I managed to get an encrypted value. String: hellohellohellohello Encoded: d2fde01cb467a97de2e56bbd76fb0855 Key: cekpo IV: cekpo My code: QString enc = "d2fde01cb467a97de2e56bbd76fb0855"; QCA::Initializer init; QCA::SymmetricKey key(QByteArray("cekpo")); QCA::InitializationVector iv(QByteArra...

Static or random IV for a license file

I have made a small program that will allow me to send licenses in encrypted form to users. At the moment I have An RSA private key that encrypts my AES key A single AES/CBC key that encrypts the data An RSA public key Both the AES and public key are hard coded onto the device. How should I deal with the IV when a license is reque...

Encrypt with openssl and decrypt on iPhone with AES 128, ecb mode

Update : found the solution. I will update this question soon with the actual working code and command. A client is encrypting a file server-side with C++, and I need to decrypt it in an iPhone application. My client can crypt and decrypt on his side, and so do I on the iPhone, but we can't decrypt the file encrypted by each other. I...