decryption

Importing a private-public exchange key pair

Hi I want to export a RSA 1024 private-public exchange key pair from Machine-1 to Machine-2. I am using cryptoAPI in XP. In Machine-1, i generated the key pair. I wrapped a session key which actually encrypts some real data. The key container name is "PAIR1". In Machine-2, i wanted to unwrap the session key with the private key(which ...

encryption/decryption & java - basic questions

I have to implement the following scenario. User calls a webservice sending a request with a text which must be encrypted by my service if it isn't encrypted. After that it should be stored in the database. Is it a good idea to declare this attribute in xsd as String or is it a better type? Should I allow to use CDATA? Using Jaxb I wi...

AES equivalent in Ruby openssl?

Gibberish library provides a nice CBC algo... // In Jascascript GibberishAES.enc("Made with Gibberish\n", "password"); // Outputs: "U2FsdGVkX1+21O5RB08bavFTq7Yq/gChmXrO3f00tvJaT55A5pPvqw0zFVnHSW1o" # On the command line echo "U2FsdGVkX1+21O5RB08bavFTq7Yq/gChmXrO3f00tvJaT55A5pPvqw0zFVnHSW1o" | openssl enc -d -aes-256-cbc -a -k passw...

iPhone: supported algorithm for Encryption /decryption

hi all, i am new to iPhone. i want to know which Encryption /decryption algorithm is supported by iPhone ? please suggest or provide me some helpful link ...

Decrypting a file in Java and exporting it to a file without going into infinite loops?

How do you decrypt a file in java and export it to a file without having to end up in an infinite loop if you have more than one user and password. Here is my code and at the end is my test file: import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOE...

Very complicated regular expression

I've been stuck trying to write this regular expression I need. Basically, I have a long string comprised of two different types of data: [a-f0-9]{32} [a-zA-Z0-9=]{x} The thing is, x is only constant in the particular instance: if in one case, it happens to be 12, it will be 12 for that particular dataset, but next time I run the reg...

.NET file Decryption - Bad Data

I am in the process of rewriting an old application. The old app stored data in a scoreboard file that was encrypted with the following code: private const String SSecretKey = @"?B?n?Mj?"; public DataTable GetScoreboardFromFile() { FileInfo f = new FileInfo(scoreBoardLocation); if (!f.Exists) { return setupNewScoreB...

Creating RSA keys from known parameters in Java

I'm working on implementing Bing Cashback. In order to verify an incoming request from Bing as valid they provide a signature. The signature is a 160-bit SHA-1 hash of the url encrypted using RSA. Microsoft provides the RSA "public key", modulus and exponent, with which I'm supposed to decrypt the hash. Is there a way to create the Jav...

Decrypting string using ASP.Net encrypted by Php

I am encrypting My data in PHP like this : $encrypted_string = mcrypt_encrypt(MCRYPT_DES, 'abcdefgh' , $input, MCRYPT_MODE_CBC, 'qwerasdf' ); $encrypted_string = base64_encode($encrypted_string); return $encrypted_string; And Decrypting the Same in C# like this : public string Decrypt(string input) { input = Server.UrlDecode(inp...

Is there a secure cryptographic algorithm where encryption and decryption can be in any order?

I'm looking for a cryptographic algorithm that satisfies the following rules: E(key1, E(key2, Message)) = E(key2, E(key1, Message)) And obviously the same for decryption as well. This is probably a long shot as I doubt such an algorithm exists but thought it's worth asking. Thanks ...

RijndaelManaged "Padding is invalid and cannot be removed" that only occurs when decrypting in production

I know other questions have been asked on this but none so far have provided a solution or are exactly the issue I have. The class below handles the encryption and decryption of strings, the key and vector passed in are ALWAYS the same. The strings being encrypted and decrypted are always numbers, most work but the occasional one fails...

[C#] Decrypt a media file and play it without saving to the HDD

Hi, I need to develop WinForms app, which will be able to decrypt a media file (a movie) and then play it without saving decrypted file to the HDD (the decrypted file finally will be stored in the memory stream) The problem is, how then play that movie from the memory stream ? Is it possible ? ...

Better way save password in mysql which can be decrypted also using php

Hi, I am currently using md5 function to encrypt my password and save to mysql db which can not be decrypted. Now my user want that when they forgot password, they should get same (old) password instead of new password. So my question is that what should i use to encrypt my password and store in mysql Database. And i can decrypt that...

Windows Mobile content encryption

In my windows mobile application (v.6.x) I'm downloading media files onto the device. Is there a beaten path for encrypting this content? So that the media file can just be decrypted by the application, e.g. shuffle every 100th byte or something like that ...

Decrypt file in C++ with Microsoft Crypt API that was encrypted with TripleDES in C#

Hi all, I'm trying to decrypt a file in unmanaged C++ that was previously encrypted with C# TripleDESCryptoServiceProvider. Unfortunately I do not have a clue how to do that with the Microsoft Crypt API (advapi32.lib). Here is the C# code that I use to encrypt the data: private static void EncryptData(MemoryStream streamToEncrypt) {...

PHP encryption and decryption

Hello guys, Please I need your help, Here is my encryption codes in PHP, it works fine but I don't know how to decrypt it in PHP. I need to get the actual value back. I have similar code in c# and I was able to get the same results. But I need to decrypt the value. <?php $DATA= 'james' ; $KEY= 'moveme'; $hash = hash_hmac("sha256", ...

encryption and decryption that work for both c# and php

Is there any encryption and decryption Algorithms that work for both php and c#? Please I need a sample codes ...

CAPICOM Decrypt() errors with "ASN1 bad tag value met"

I have a large amount of data encrypted with the CAPICOM library through our legacy VB6 applications. I need to access this data from a .Net 3.5 app but am getting the error: "ASN1 bad tag value met" when I call the Decrypt method. Google has been little help in tracking down decent code samples or explanations as to what this error me...

Convert string to whitespace

I'm looking for av way to convert a string into whitespace; spaces, newlines and tabs, and the other way around. I found a Python script, but I have no idea how to do it using Javascript. I need it for a white-hacking contest. ...

How do I improve breaking substitution ciphers programmically?

I have written (am writting) a program to analysis encrypted text and attempt to analysis and break it using frequency analysis. The encrypted text takes the form of each letter being substituted for some other letter ie. a->m b->z c->t etc etc. all spaces and non alpha chars are removed and upper case letters made lowercase. An exampl...