encryption

c# AES CBC using 2 methods to add 2 pieces of encypted data into one file

The key issue is if I use a new cryptostream it will add new IV to second piece of data. Then this wont be ablt to decrypted. So I need to make sure the stream will use the last block of 1st data to encrypt the first block of 2nd piece of data. It comes up with the task of using same stream to encyprt 2 piece of data. But I couldn't fig...

AES encryption - how to later decrypt the encrypted string ?

i have a java program . this is a AES encryption - decryption program. the program has a graphical user interface with can input string and show AES encrypted string. the program also shows original string by using decryption function written in the code. the interface is such that when string is entered and convert button is clicked the...

Encryption in Java & Flex

I want tp encrypt and decrypt string, with defined salt. But the result must be same if the code run in java and adobe flex. The main goal is: the app in adobe flex will be generate a string that can be decrypt in server using java. I use this flex library http://crypto.hurlant.com/demo/ Try to 'Secret Key' Tab. I want to use AES Encr...

Encryption code segment which I do not understand

I am reading about encryption and having a lot of difficulty understanding these 3 Java statements of an encryption program. cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); encrypted = cipher.doFinal(str.getBytes()) Can somebody help? ...

How do I make Ruby read .cer public ssl key?

Hey, I am working on a RoR website that requires an e-payment module. The e-payment implementation requires that the xml data is encoded using a public ssl key provided by them. What I tried to do in Ruby: public_key = OpenSSL::PKey::RSA.new(File.read(public_key_file)) If I just try to open the file separately it works fine. But the...

Encrypting Querystring and Decrypting it in PHP

I have the following Encryption Classs in php define(ENCRYPTION_KEY,"abcdegef"); define(INITIALIZATION_VECTOR,mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_DES, MCRYPT_MODE_ECB), MCRYPT_RAND)); function EncryptString($input) { $encrypted_string = mcrypt_encrypt(MCRYPT_DES, ENCRYPTION_KEY, $input, MCRYPT_MODE_CBC, INITIALIZATION_VECTOR...

DSA problem - create DSA public/private key with .NET, use the public key with Java(android)

Here is the setup: I create public/private key pair with .NET, I want to sign a string. I take a random string, get a byte[] from it, sign it, and take the signature in the java app. I want to verify it in java ( (!)I'm talking about Android's java). The process to take the public key to Java environment: When I create the public key, ...

Simple use of RSACryptoServiceProvider KeyPassword fails

I want to protect my RSA private key with a password (who wouldn't) but the following C# fails: SecureString pw = new SecureString(); pw.AppendChar('x'); CspParameters prms = new CspParameters(); prms.KeyPassword = pw; RSACryptoServiceProvider crypto = new RSACryptoServiceProvider(prms); byte[] encrypted = crypto.Encrypt(Encoding.ASCII...

How to encrypt a string using InstallScript

I'm building an installer using InstallScript MSI project. During installation I save some information to a local file. This file is created based on the user's preferences and it may contain sensitive information. I would like to encrypt this information but couldn't find any InstallScript function to handle this. I know I can have fe...

encryption algorithm for the application

What encryption algorithm is better to use? client-Delphi, server-Python. Recommend please simple algorithms and libraries .. ...

Cannot decrypt cyphertext from text file, symmetric key implement. in java

Hello there. So basically my program encrypt/decrypt string from text file which user choose. He can select one of five algorithms. The problem is when I create ciphertext with eg. AES and then save this ciphertext to text file and want to decrypt it to get the original string it does not work. Can someone point out where is the problem ...

Multi User Password Manager Security Strategy

I am considering creating my own web based, multi user password management software. The basic question that comes up is, what strategy will I use for secure storage and retrieval of passwords? Obviously, I don't want to store information in clear text. Should I encrypt/decrypt on the database server, web server, client (javascript), o...

Convert string / character to integer in python

I want to convert a single character of a string into an integer, add 2 to it, and then convert it back to a string. Hence, A becomes C, K becomes M, etc. ...

Easy way to store/restore encryption key for decrypting string in java

For encryption I use something like this: SecretKey aesKey = KeyGenerator.getInstance("AES").generateKey(); StringEncrypter aesEncrypt = new StringEncrypter(aesKey, aesKey.getAlgorithm()); String aesEncrypted= aesEncrypt.encrypt(StringContent); If I print out aesKey I get: "javax.crypto.spec.SecretKeySpec@1708d". So for encryption I ...

How to use generated and encoded key in jce

If I generate a key like this: SecretKey aesKey = KeyGenerator.getInstance("AES").generateKey(); Then decode it: System.out.println("used key: " + aesKlic.getEncoded()); And now I want to use it for decryption(after exiting program and starting again). Obviously, something like this does not work: SecretKey aesKey = javax.cr...

Padding error - when using AES Encryption in Java and Decryption in C

I have a problem while decrypting the xl file in rijndael 'c' code (The file got encrypted in Java through JCE) and this problem is happening only for the excel files types which having formula's. Remaining all file type encryption/decryption is happening properly. (If i decrypt the same file in java the output is coming fine.) While i...

Unencrypted SSL protocol?

Is it possible to send a message over https that isn't encrypted? For example, require that certificate validation and authorization occur, but not encrypt the actual data being sent over the socket? ...

Returning a decyphered string as part of tuple in Haskell

Hi For project euler 59, I came up with this to return a list of tuples containing the decyphered string and the key used (and yes I know about Data.Bits): module XOR where import Data.List import Data.Char decToBin :: Integer -> [Integer] decToBin x = reverse $ decToBin' x where decToBin' 0 = [] decToBin' y = let (a...

A question about the key in AES

I saw some code like string password = "11111111"; Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(password,Encoding.ASCII.GetBytes("22222222")); RijndaelAlg.Key = key.GetBytes(RijndaelAlg.KeySize / 8); I can see the key is generated by Rfc2898DeriveBytes with passphrase and salt. Then AES retreive the key by GetBytes. But the questi...

Password Recovery using Asp.net

Hi, In my application, the password is encrypted and if the user forgets the password , there is no way to recover the password.Now we are cancelling that user account and creating a new one.Now i want a proper method to recover the password.The login is done using the Asp.net configuration tool.How can i recover my password using this?I...