encryption

Why are RijndaelManaged and AesCryptoServiceProvider returning different results?

Here is the example that I have run. It has the same Mode, Padding, BlockSize, KeySize. I am using the same init vector, key and data. Using the RijndaelManaged produces an encrypted value of: 0x8d,0x81,0x27,0xc6,0x3c,0xe2,0x53,0x2f,0x35,0x78,0x90,0xc2,0x2e,0x3b,0x8a,0x61, 0x41,0x47,0xd6,0xd0,0xff,0x92,0x72,0x3d,0xc6,0x16,0x2b,0xd8,0x...

Way to encrypt a single int

How can you inexpensively two-way encrypt a 32 bit int, such that every number maps to some other int in that space and back in a way that's difficult to predict? And doesn't require pre-storing 4.29 billion ints in a mapping table, of course. ...

How do I digitally sign and trust a message in a distributed program I know can be reverse engineered?

The problem in brief: I develop an application (for example a game) which is distributed in binary form. The game calls home and sends the user's high score as a message to an online game server. What I'd like to do is digitally encrypt and sign the message so that I can trust it hasn't been tampered with. Public key cryptography relie...

C# - Serializing/Deserializing a DES encrypted file from a stream

Does anyone have any examples of how to encrypt serialized data to a file and then read it back using DES? I've written some code already that isn't working, but I'd rather see a fresh attempt instead of pursuing my code. EDIT: Sorry, forgot to mention I need an example using XmlSerializer.Serialize/Deserialize. ...

Cryptography - Please help me understand Key Length Requirements

I'm having a bit of difficulty getting an understand of key length requirements in cryptography. I'm currently using DES which I believe is 56 bits... now, by converting an 8 character password to a byte[] my cryptography works. If I use a 7 digit password, it doesn't. Now, forgive me if I'm wrong, but is that because ASCII characters a...

ASP.Net SessionState using SQL Server - is the data encrypted?

When using Sql Server to store and manage the SessionState, is the session data stored in the database using encryption? When I look at the data in the ASPNet database, the data in the "SessionItemLong" in the ASPStateTempSessions columns appears to be hexadecimal data. Is this data being encrypted before being stored in the database? ...

PKCS#10 request for a object key pair from PKCS#11

Hello There I have a RSA 1024 key pair generated using standard call from PKCS#11. I need to generate a PKCS#10 CSR for the public key. MS has the IEnroll4 dll which will allow to raise a CSR using createRequestWStr. The samples indicate that you need to generate a new key pair(a container with 2 objects in MS CAPI) and MS automatical...

How to use 'System.Security.Cryptography.AesManaged' to encrypt a byte[] ?

Hi, Basically i want to use System.Security.Cryptography.AesManaged (or a better class, if you think there is one?) to take one byte array and create another encrypted byte array, using a given symmetric key (i assume i'll need one?). I also will need the way to reverse this procedure. The point of this is so i can encrypt stored pass...

Encrypted using AES and passing in querystring, will Html.Encode make it work?

I am Encrypted using AES and passing in querystring, will Html.Encode convert all the characters properly such that calling Decode will result in the same string? ...

.Net Simple RSA encryption

Hi, I'm trying to encrypt something simple, like int or long. Simplest way I found looks like: int num = 2; RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); byte[] numBytes = BitConverter.GetBytes(num); byte[] encryptedBytes = rsa.Encrypt(numBytes, true); Problem is, the encryptedBytes is 128 bytes long. How can I encry...

How to create AES encryption and decryption program in symbian

I want to create AES encryption and decryption program in symbian which must be compatible with AES encryption in java Means if I encrypt the data in Symbian I must be able to decrypt the same in java and vice versa Thanks Sunil ...

Most effective way to decrypt data when encryption method is unknown?

I have a large amount of data that was encrypted by a third party tool before it was backed up, now we no longer have access to the tool and I NEED the data what is the most effective way to try and determine how the data was encrypted? ...

How to use CBC encryption mode in PHP

Hi, I'm trying to encrypt a string, 50-150 characters long, with AES in a mode other than ECB (due to security issues). I wrote an encryption class and am able to encrypt/decrypt perfectly in ECB mode, however when I switch to CBC, CTR or OFB mode, I fail to get the original plaintext back. Source: define('DEFAULT_ENCRYPTION_KEY', 'as...

Obfuscate strings in Python

I have a password string that must be passed to a method. Everything works fine but I don't feel comfortable storing the password in clear text. Is there a way to obfuscate the string or to truly encrypt it? I'm aware that obfuscation can be reverse engineered, but I think I should at least try to cover up the password a bit. At the very...

How do I know if an email cannot be unencrypted in Outlook?

When you use the Outlook API to access the Body of an email that's encrypted that you don't have the key for, Outlook throws an exception that says something like "Your Digital ID cannot be found by the underlying security system." Is there a way to determine whether an encrypted message (MessageClass "IPM.Note.SMIME") can be read withou...

Thread Safety of .NET Encryption Classes?

I have a high-level goal of creating a static utility class that encapsulates the encryption for my .NET application. Inside I'd like to minimize the object creations that aren't necessary. My question is: what is the thread-safety of the classes which implement symmetric encryption within the .NET Framework? Specifically System.Secur...

How do I encrypt a string and get a equal length encrypted string?

My problem is the following: In an existing database I want to encrypt data in a couple of columns. The columns contains strings of different lengths. I don't want to change the size of the columns so the encryption need to produce an equal length text representation of the input text. The strength of the encryption algorithm is of se...

How to encrypt a data using symbian C++, so that i can decrypt the same data using java

How to encrypt a data using symbian C++, so that i can decrypt the same data using java Thanks Sunil ...

Encrypted file or db in python

I have a sqlite3 db which i insert/select from in python. The app works great but i want to tweak it so no one can read from the DB without a password. How can i do this in python? note i have no idea where to start. ...

How would I reverse engineer a cryptographic algorithm?

I wrote an application that encrypts text in this way: Get the input text Reverse the text Convert to hexadecimal XOR with a key Base64 encode Now, I didn't do a lot of encryption/encoding myself, so my question might sound stupid, but, say I get a file which has a content from the above algorithm and I didn't know about this algorit...