encryption

How to implement IDEA?

Hello, I have to make an application which can encrypt and decrypt text file using IDEA(International Data Encryption Algorithm) in java or C#. I know that in java there is inbuilt JCE(Java Cryptography Extension) but how to proceed further, will anybody please give me some suggestions? thank you. ...

How to 3DES encrypt in Python using the M2Crypto wrapper?

I have a working test of a hardware device that uses RSA encryption, in Python using M2Crypto. Now I need to test a similar device that uses 3DES encryption. But I can't figure out how to use M2Crypto to do triple DES encryption. I know it should be possible from this chart. But unfortunately the documentation of M2Crypto I've found ...

Safe Encrypt/Decrypt Functions

Given an input string (will actually be an integer value) and an encryption key, I need to encrypt the input string in such a way that the resulting string is: URL safe (my permitted URI characters is currently: a-z 0-9~%.:_-) Filename safe (meaning, it only uses valid directory/filename characters) FTP account username safe Email acco...

Encryption of log4net in config file

Hi everyone, I am trying to encrypt sections of the application configuration file (app.exe.config) for security purposes. I succeeded in encryption the appSettings and connectionStrings. However, I get the following error when I try to encrypt the log4net part: System.Configuration.ConfigurationErrorsException: An error occurred crea...

Java AES encryption with C/C++ AES decryption question

I am doing a simple AES encryption in Java: Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, getAES128SecretKey()); byte[] encrypted = cipher.doFinal(input); The output is converted to hex and stored in a database. A later process (one written in C/C++) comes along and reads the hex, converts it to bytes an...

What algorithm can I use for encryption in Java?

What algorithm can I use for creating an encryption program in Java? What if I want to use the same key for encrypting and decrypting? Example: I type Hello world and use the key guy, so the words change into xgdsts@dtoll. If I want to decrypt it, I have to use the same key(guy) so it'll become hello world again ...

Any way to use multiple encryptions on one string without doubling or expanding the size of the output string?

My input string suppose is: 256 Bytes Ascii text. Let's assume I encrypted it with an encryption algo. But when I re-encrypt the same encrypted result string which was output of the first encryption, the size of the second result string from the second encryption from the same encryption algo increases, even doubles! Dear friends! Is th...

What should I encode my passwords to?

I'm starting a new ASP.Net application from scratch. What should I use to encode passwords and what should my column be? Just a simple varchar(512)? Thanks for any advice. ...

AES128 iphone encryption matches until the very end

I'm trying to encrypt data to be transferred back and fourth between a server but I can't seem to get the right output in objective-c: (full code here: http://pastebin.com/zPdHxShu) // 128-bit key, CBC mode // ------------------------ // IV = '1234567890123456' // (hex: 31323334353637383930313233343536) // Key = '123456789012345...

PHP & HTML: Encrypt form

Hi all, I have forms within my website. Some of these forms include PayPal forms (forms that submit information to PayPal). I do not wish my customers to view the source code and see what fields & their respective values I am using. As such I wish to encrypt them and yet, be able to submit information securely over to PayPal with the va...

Looking for a model explaining the internal structure of a PGP-signed & encrypted file

I'm trying to debug & extend an existing piece of Java code using BouncyCastle to decrypt and verify secured attachments. I've looked through the BouncyCastle samples but what it's harder to extract from there is a model of what a PGP-secured attachments looks like. From the code and various errors I can infer there is something repres...

Convert a PKCS#8 private key to PEM in java

Hello everyone I'm trying to convert a PKCS#8 private key that I generate in my java program to a PEM encoded file. Security.addProvider(new BouncyCastleProvider()); SecureRandom rand = new SecureRandom(); JDKKeyPairGenerator.RSA keyPairGen = new JDKKeyPairGenerator.RSA(); keyPairGen.initialize(2048, rand); KeyPair keyPair = ke...

simple encryption survey

Suppose you are writing a survey application and would like to somehow guarantee results to be secure from user stand point. Put simply, i know what IP you came from but i want to make sure you sleep well at night knowing i know nothing of your responses. I can't store IP in raw form. I do need to guarantee 1 thing though, that is that ...

Would this cookie system be secure for storeing passwords?

I'd like input on this cookie password storing security system, When the user ticks the remember me box, it stores these cookies: User name in plain text. Password encrypted with a completely random key that the server stores in the database, that is never passed to the client and is user-specific, changes with every login. And the se...

How to restrict viral file sharing

So I have a website I would like to make that would essentially be selling files. For the sake of discussion let's say that these files are like the raw text of a book. If somebody buys a file from my site, there really isn't anything preventing them from sharing that unlimited amounts of times with their neighbor or whatever. I know th...

Basic encryption on Android

I have seen the example here. All well and good and I understand it, however it relies on the bounceycastle library for the provider. I don't want to bundle any additional third party libraries with my app if I can help it. I don't need fort knox style security, just some basic symmetric encryption for transmitting over the wire. How can...

Encrypting multiple elements of one xml document

Hello, I managed encrypting an xml document by encrypting an element and then replacing the element with the encrypted data. A shown in the sample code below. Public Shared Sub Encrypt(ByVal textReader As TextReader, ByVal textWriter As TextWriter, ByVal certificateName As String) Dim xmlDoc As New XmlDocument() xmlDoc.Load(tex...

how to shorten the url in a mathematical approach

I am looking into the possibility of shortening / encrypting a url which will be from 150 to 250 characters in length to maximum 12 characters using an algorithm. Initially I am doubting it's possible but I wanted to leverage the great minds of StackOverflow :) the algorithm should be one that can be written in classic asp, sql, c#, vb...

query string parameter obfuscation

I want to obfuscate one query string parameter in ASP.NET. The site will have a high volume of request, so the algorithm shouldn't be too slow. My problem is that all the algorithms I found result in unwanted characters (like +/=) Here is an example of what i want to achieve: www.domain.com/?id=1844 to www.domain.com/?id=3GQ5DTL3...

GWT/Javascript client side password encryption

I'm implementing authorization in my gwt app, and at the moment it's done in the following fashion: The user signs up by putting his credentials in a form, and I send them in clear text to the server The server code hashes the received password using BCrypt and puts the hash in a database When the user wishes to log in, his password is...