encryption

Fast asymmetric cypher for C++ application

Hello. I'm looking for a fast asymmetric cypher algorithm to be used in C++ program. Our application accesses read-only data stored in archive (custom format, somewhat similar to tar), and I would like to prevent any modifications of that archive by asymmetrically encrypting archive index (I'm aware that this isn't a perfect solution an...

How should I secure a SOA with inter-service communication between data centers?

For my pet project I've decided on a services based architecture (yeah the buzzword SOA) because I can scale each service independent of others, distribute them geographically where they will be used more than other services, etc. The trick is that some of the services need to communicate privately with each other (and publicly with en...

Encryption of Objects stored to disk using C++ (for a Java Developer)

Hi All, This is two questions in one but hopefully trivial to a C++ developer. How can I seralize an object so that I can write it to disk and retrieve it later in C++ or if this is the wrong keyword how can I write an object as a binary stream and recreate it later? Can I use inheritance to make a hierarchy of classes serializable? w...

Algorithm for finding possible ways of simple, multiple encryption with the alphabet

When using a simple encryption method in which the letters are replaced by the indexing numbers of the alphabet, there are multiple ways of decrypting them, ex. ABOR is 121518 but 121518 could also be AYEAH or LAER. Well I need an algorithm to calculate how many possible ways there are for a given number to decrypt the message via the ...

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...

Android SecretKeyFactory problems. Implementation not found?

Hello all, I'm trying to create an application for Android that uses encryption to save user information and I cannot figure out what I'm doing wrong. I'm trying to create an instance of the SecretKeyFactory using the "PBKDF2WithHmacSHA1" algorithm, but the application keeps on throwing exceptions at that point in the program (it doesn...

How to protect file system?

Hi, I want to store large files (videos, sounds) and access them via Database. I am balancing now between filesystem (references to files would be stored in DB) and pure DB (which could be enormously large after time). I have to protect the content too, so I thought, that DB solution suits better for this purpose. (probably it is not a...

Verify source of HTTP request

I've got two systems that need to talk. The systems are setup likeso: System A, running Django (Python 2.5) on Google App Engine (GAE) System B, running Django (Python 2.6) on Ubuntu/Linux over Lighttpd (maybe nginx, later) System A will periodically make requests ('requisitions') of System B using Url Fetch. System B has a Django ap...

Android Cipher problems. InvalidKeyException?

Hello all, I'm trying to create an application for Android that uses encryption to save user information and I cannot figure out what I'm doing wrong. I'm trying to create an instance of an AES cipher but the application keeps on throwing "InvalidKeyExceptions." Consider the following code: public static final byte[] IV = new byte[] {...

LibTomCrypt and LibTomMath—development status?

LibTomCrypt in the past has seemed like a very viable and useful option for encryption. And the associated LibTomMath could be a useful math library. But lately, I can't see any development on it and it's ambiguous as to what is the "current" web site for it. E.g.: http://libtomcrypt.com/ which points to http://libtom.org/ old page h...

Storing information ecoded in mysql

Hello! I have a field in my database and i want to store the information encoded. So i would like use the AES_ENCRYPT(), AES_DECRYPT() functions. I have a little problem about the right usage... So this is my code what i need to modify, but i try it many ways and always get SQL syntax error. $query="update users set test='".$_POST...

Do I need to encode encrypted bytes before sending?

Do I need to encode my encrypted bytes when sending it through java data streams for instant messaging? Sending encrypted bytes don't look very safe to me. If so, should I use Hex or Base64 encoding? Thanks ...

use bouncy castle to create public key on j2me

I got the public key from the certificate, keypair is a java.security.KeyPair object String public_key = keypair.getPublic().toString(); I want to send this to the via an http connection to a J2me application. I cannot find any documentation to convert the transmitted string to a Public key that can be used to encrypt Strings. I also...

Encrypted Session Token for Silverlight App

I am building a Sivlerlight app that calls methods on a WCF middle-tier application for its data. I don't want the middle-tier to have to lookup the user/pass in the DB for every call, so I want to use an encrypted token created by the server to be passed from the client to the server as evidence that the requestor is valid. I was wond...

"Padding is invalid and cannot be removed" -Whats wrong with this code?

Every time I run this and encrypt, the output is variable, and when I attempt to decrypt I get "Padding is invalid and cannot be removed." Been fighting with this for a day or two now and I am at a loss. private static string strIV = "abcdefghijklmnmo"; //The initialization vector. private static string strKey = "abcdefghijklmnm...

Issue while encoding a string

Hello All I'm developing an application where at some point i need an encoded stream of bytes based on the given user output. Something like Encoding sysEncode = System.Text.Encoding.GetEncoding(850); byte[] dataToEncrypt = sysEncode.GetBytes(m_oStrActivation); However when i extract the string from the byte stream i get the encryp...

Retrieving encrypted data in code

I am using sql server 2k5 database encryption with a symmetric key protected by password. Symmteric key password is stored in memory on the server and cannot be stored in plain text in sps. In SQL Mgmt Studio, i run a query opening key, exec Mysp and closing key - data returns decrypted. In my c# code tho, when i want to call the same s...

What to do when you can not save a password as a hash.

I have a program that uses System.DirectoryServices.AccountManagement.PrincipalContext to verify that the information a user entered in a setup screen is a valid user on the domain (the computer itself is not on the domain) and do some operations on the users of the domain. The issue is I do not want the user to need to enter his or her ...

Sign data with MD5WithRSA from .Pem/.Pkcs8 keyfile in C#

Hi, I've got the following code sample in Java, and I need to re-enact it in C#: PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(pkcs8PrivateKey); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); PrivateKey privKey = keyFactory.generatePrivate(privKeySpec); Signature sign = Signature.getInstance("MD5withRSA"); sign.init...

What is the best way to encrypt SSNs in SQL Server 2008?

I am developing a new web application using .NET 3.5 and SQL Server 2008 that will need to store some Social Security Numbers. I've been doing some initial reading on database encryption and it's a little bit confusing. I would be nice to encrypt the SSNs using an asymmetric key, since that way the public facing application wouldn't be ...