encryption

Encrypted JDBC connection

I do a lot of work on databases over the internet. My company is instituting a policy of not sending any non-encrypted information (including vanilla JDBC). I currently connect to MS Sql Server and db2 databases (both LUW and AS/400). Is there an easy way to encrypt/decript these connections? Edit: Found an interesting and relatively...

What do you think of my simple Java class that encrypts text into SHA-1?

Anyway I'm starting out to make Java programs (a programming newb) and I've decide to do a simple utility class that converts text into SHA-1 strings. I'm planning on using this to encrypt passwords for databases. Feel free to comment and I'd love to learn from you guys. Here's my code: /* * Utility class that encrypts a string created...

What is the best way to implement 2-way encryption with PHP?

I would like to encrypt the passwords on my site using a 2-way encryption within PHP. I have come across the mcrypt library, but it seems so cumbersome. Anyone know of any other methods that are easier, but yet secure? I do have access to the Zend Framework, so a solution using it would do as well. I actually need the 2-way encryptio...

Difference between symmetric crypto algorithms

C# looks to have 4 different symmetric crypto algorithms: RijndaelManaged, DESCryptoServiceProvider, RC2CryptoServiceProvider, and TripleDESCryptoServiceProvider. I am looking for more information between them. Mainly what is the differences between each of them. MSDN isn't being much help, or I am just tired. ;) I am sure there is pro...

Converting a Java Keystore into PEM Format.

I am trying to convert into Java keystore file into a PEM file using keytool and openssl applicactions. But I could not find a good way to do the conversion. Any idea? Instead of converting the kaystore into PEM I tried to create a PKCS12 file first and then convert into relevant PEM file and Keystore. But I could not establish connect...

Keeping passwords in the registry as "secrets"

I need to store my users' name/password somewhere (preferably the Registry) so my .Net application can use them to log in to some remote service on behalf of the user. I know it's possible to store values in the registry as "secrets", which means their encrypted using the Windows domain user token or something. In other words, I don't wa...

PHP: PEAR: Encrypting with Crypt_CBC, Decrypting with Perl's CBC

Hi, One of the tasks I have to do needs me to encrypt something from PHP's side, and then decrypt it with Perl. The PEAR module I've found which appeared to be suitable for my needs was Crypt_CBC. However, there must be something I'm doing wrong or do not understand, as I've been unable to achieve getting the correct results so far. ...

Python: How to add RSA padding?

I've been looking at most python crypto libraries, I've decided to use either PyCrypto or M2Crypto. I've discarded ezPyCrypto because it only supports MD5 for signing and Keyczar because it's not mature enough. So I've read that RSA is vulnerable to several attacks if the to-be-encrypted text (or signature hash) is not properly padded. ...

php mcrypt_encrypt to C/C++/MFC equalivilent

Hello I have a PHP script that generates a product key for an application written in c++/MFC. The product key is email to the user and the user copy and pasts it in to my application. function EncryptData( $data ) { $key = "abcdefghijklmnopqrstuvwxyz"; // This encrypt method is described here // http://ca3.php.net/mcrypt $val =...

System.Security.Cryptography and "Bad Data" - character encoding?

The class that produces "Bad Data" errors: using System; using System.Collections.Generic; using System.Security.Cryptography; using System.Text; using System.Windows.Forms; namespace MyNameSpace { public class RSAcrypt { private string _encryptedData; private string _decryptedData; public string EncryptedData {...

How to Best Handle Authentication Via the URL in PHP

I need to be able to send users a link that contains an encrypted value which is used to authenticate the user when they visit the link. The current process uses a salt and roughly 40 character unique hash which is then encrypted and base64 encoded so that it can be safely be transported via email and in theory come back safely through...

AES in ASP.NET with VB.NET

What is a good link or article on encrypting a URL link with AES to pass username to another web site in ASP.NET using VB.NET 2005? FYI: The receiving web site will have access to the private KEY to decrypt. ...

Encrypted data in URL and salt

When passing symetrically encrypted data in a URL or possibly storing encrypted data in a cookie, is it resonable and/or nessassary and/or possible to also pass the Symetric Encryption IV (Salt) in the same URL? Is the idea of using Salt even valid in a stateless environment such as the web? (I understand how salt works in a database gi...

Mimic AES_ENCRYPT and AES_DECRYPT functions in Ruby

Hello there! I need to mimic what MySQL does when encrypting and decrypting strings using built-in functions AES_ENCRYPT() and AES_DECRYPT(). I have read a couple of blog posts and apparently MySQL uses AES 128-bit encryption for those functions. On top of that, since this encryption requires a 16-bit key, MySQL pads the string with x0...

How do I send and receive encrypted email in Ruby on Rails?

I have a rails application that triggers Emails on certain events. These emails are sent to a separate company who will add some additional data to the email when replying. This is all understood and working, I am parsing the replies, extracting the data and it works fine. I have now been asked to encrypt the emails. Does anyone have a...

Encrypting web.config using Protected Configuration pointless?

I must be missing something... So I am in the process of figuring out the best way of encrypting the database connection string and sql session state connection info in web.config. I quickly find a walk through on msdn explaining using protected configuration to encrypt parts of the web.config: MSDN walkthrough on using Protected Config...

Encrypted data size using RSA encryption (RSACryptoServiceProvider)

I need to use some encryption mechanism in one of the project I am working on. I was exploring RSA encryption and wrote some sample programs to learn. I understand that block size of RSA encryption is 16 bytes. So I gave the string "12345678" as input to below function: public static string Encrypt (string input) { var byteConvert...

.NET implementation (libraries) of elliptic curve cryptography

Please can you suggest any implementation of elliptical curve cryptography to be used on .NET platform? Also if you have used them, can you tell me the recommended curves that should be used? [EDIT] As @FatCat mentioned, its implementation is available in .NET framework 3.5 but that is only available on windows vista. Can you please s...

Given a private key, is it possible to derive it's public key?

From whatever little I understand by reading various material, public-private key pair are the basis of assymetric encryption and also something about choosing 2 prime numbers (which is roughly your private key) and multiplying them (which is roughly your public key), I appears that it is possible to generate a public key if you know the...

What is the best PHP code encryptor?

Duplicate: YUI -like compressor for PHP? What is the best PHP code encryptor? The original question was edited and changed in its sense!!! I am looking for a source encrypting software and I want to know your opinion!!! I am not looking for a obfuscator, not a YUI-like-compressor! ...