encryption

Using System.Security.Cryptography to encrypt text to match OpenSSL

I need to encrypt text (a password specifically) correctly so a 3rd party can decrypt it. They have provided me with the key they use to decrypt and told me that they will be decrypting it on their end with OpenSSL. I have been trying to get the AESManaged, and the RijndaelManaged classes in System.Security.Cryptography to create someth...

Encrypt your hard disk in C#

How to secure a hard disk programmatically through C#? Like if a user wants to open a hard disk and first he/she has to give a password to access it. If the password is wrong then the hard disk is hidden from that user.. ...

Rails database - how to store encrypted data using the user's password?

I have a database that will be holding sensitive data, so it should be encrypted in the database. Basically the sensitive data are credentials to another web site. So I want to encrypt them with the users password + salt. To decrypt the credentials one would need the password. I see two ways: On login, I could decrypt the credentials...

Coldfusion 9 Encryption Key from Java Byte Array

I am working on a project where we are passing encrypted data between C#, Java and ColdFusion applications. To generate the key and iv for 256 bit AES encryption. I have the following array which I need to convert in ColdFusion 9 to useable key The Java Code for the Key new byte[]{ (byte)172, (byte)181, (byte)241, (byte)2...

Why in brute force attack on Symmetric Algorithm there is 50 percent chance of finding the key after half of the attempts?

Any cryptography text mentions that in brute force attack on Symmetric Algorithm there is 50 percent chance of finding the key after half of the attempt. For e.g. DES with 56 bit key would have 50 percent chance of finding the key after first 2 to the power 55 attempts. Why in a brute force attack against any symmetric encryption algo...

[.NET] Storing an encrypted password into a database

I thought this would've been a lot simpler but at this point I'm confused and haven't progressed at all. Basically, I need to be able to accept a password from a user in a WPF app, encrypt it then store this in a database and be able to decrypt later on. However I'm not sure how to implement this. This is completely trivial so whether...

AES Encript and Decript problem with Apache Base64

Hi, I have following programme for encrypts a data. import java.security.Key; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Base64; public class Test { private static final String ALGORITHM = "AES"; private static final byte[] keyValue = "ADBSJHJS12547896".getBytes...

encrypt a file on iphone-sdk

Hello, I'd like to have a file encryption functionality for my iphone application. For desktop based applications i used the function below to encrypt relatively small files: - (NSData *)aesEncrypt:(NSString *)key { // 'key' should be 32 bytes for AES256, will be null-padded otherwise char keyPtr[kCCKeySizeAES256+1]; // room for term...

what is the criteria to choose encryption algorithm for my system

I am working on a system which is going to be applied in the real environment. I need to make high security mechanism for the system, one of them is encryption for user's passwords in my database. I prefer to use one way encryption method to two way encryption, the problem is I want to choose a good algorithm which has good performance ...

Security of Exclusive-OR (XOR) encryption

XOR encryption is known to be quite weak. But how weak is it if I have a key that is made up of multiple keys of different (ideally prime) lengths which are combined to make a longer key. eg I have a text keys of length 5, 9 and 11. If I just apply the first key using XOR encryption then it should be easy to break as the encryption byte ...

Strip off XMLDSIG elements from incoming XML POST to WCF RESTful Service

Folks, I am building a RESTful service that is secured by providing an XMLDSIG XML signature at the bottom of the XML document. When I send this document to the server, the WCF service is doing the XML de-serialization method on the HTTP payload to give me a C# class. Unfortunately for this de-serialization to occur properly, the C# cl...

How do you convert the following encryption code from Perl (or from PHP) to VB.NET?

I have some encryption code that has been written in Perl (also a code snippet in PHP) - but I just can't get a version written in VB.NET to work with the third party. Example in Perl package Sitemaker::API::Crypt; use warnings; use strict; use base qw( Exporter ); use Crypt::CBC; use MIME::Base64; our @E...

How do I encrypt a string in vb.net using RijndaelManaged, and using PKCS5 padding?

I use the following code to initialize encryption... Dim symmetricKey As New System.Security.Cryptography.RijndaelManaged() With symmetricKey .Key = Encoding.ASCII.GetBytes(Key) .IV = Encoding.ASCII.GetBytes(IV) .Mode = CipherMode.CBC .BlockSize = 128 .KeySize = 128 .Padding = PaddingMode.PKCS7 End With The requi...

Algorithm to generate security token for MMO Login Service

I'm building a Login Service for an open source MMO game. I do not know much on the side of security/encryption and I am looking for a solution that will provide good protection against hackers and must not be too costly to generate. Our old system used a very simple system of authentication by storing the password as SHA1 in the databa...

How do I use Sql Server 2005 Symmetric or asymmetric keys through fluent nhibernate?

Here is my issue. I have an account object as follows: public class Account { public virtual int AccountId { get; set; } [Required(ErrorMessage = "Email address is required.")] public virtual string EmailAddress { get; set; } [Required(ErrorMessage = "A password is required.")] public virtu...

Re-arrange a string using every x letter position with PHP

Hey, I'm trying to figure out how to re-arrange a string using every x position so that an example input string of "ABCDEFGHI" and the x being 4 would yield DHCIFEGBA. Here's how I got that: The 1st letter is easy: it's character 4. [A, B, C, D] The 2nd letter is also easy: it's character 8. [E, F, G, H] The 3rd letter is mostly easy:...

how to generate ValueLink merchant working keys

I am trying to generate ValueLink merchant working keys using a modified version of the apache ofbiz ValueLinkApi Class - src I've modified it only to the extent of making it a standalone class that I can run from outside the context of the ofbiz framework. My program runs without error but my keys are not being accepted by the api. H...

File encryption in php - algorithm

Hello. What is the algorithm according to you is best to encrypt files using PHP? Maximum file size which provides about 100 mb. I care about the speed of the encryption ... ...

Is there a benefit of turning ViewState Encryption Off (asp.net IIS7)?

I understand how to turn off ViewState encryption for asp.net web applications. I want to know if I should. My question is more from a performance stand point than a security one (All of our traffic is on a private network and we do not store any sensitive data in the viewstate). Before I dedicate hours of setting up tests scenarios...

XOR String Encryption/Decryption

I have made programs that utilize XOR encryption of data before and fully understand it, but how can I implement this into a program so the string literals are encrypted? For instance, I do not want to use: string name = "My name is Matt"; This would cause "My name is Matt" to be located in the executable. I am guessing I would have t...