title: encryption with type information preserved
body: <p>How can we achieve asymmetric key based encryption but with type information preserved, e.g. int to int, string to string, and datetime to datetime etc.</p>
  <p>I have a situation where I want this in my application before sending data to any DB. Before sending an object to the document based DB, I want to encrypt the members of the object and set the encrypted value back to the object's members.</p>
  <p>The objects are statically typed means let say a c# or java class instance. So the scene is, we cannot assign encrypted value (that is essentially a string) to a non string data type and we don't want to create a copy of the instance holding all the encrypted values in corresponding string members, this way I will lose the type information.</p>
  <p>Any help/suggestion is much appreciated.</p>