cryptography

Need an example - decrypting string in Java using Microsoft Crypto API

First and foremost, I am not a Java programmer. I'm looking for an example solution to this problem because the Java developer I have does not have much experience working with encryption. Everything we've found online pertains to encrypting web pages and dealing with the MS keystore. We just want to work with a single string from Pow...

php mcrypt_encrypt to C/C++/MFC equalivilent

Hello I have a PHP script that generates a product key for an application written in c++/MFC. The product key is email to the user and the user copy and pasts it in to my application. function EncryptData( $data ) { $key = "abcdefghijklmnopqrstuvwxyz"; // This encrypt method is described here // http://ca3.php.net/mcrypt $val =...

AES in ASP.NET with VB.NET

What is a good link or article on encrypting a URL link with AES to pass username to another web site in ASP.NET using VB.NET 2005? FYI: The receiving web site will have access to the private KEY to decrypt. ...

Crypto library for C++

Duplicate of this one. I'm about to embark on journey that may change my career by doing a rather big project this time. I have experience in cryptography as I have taken several courses and written my own implementation of some algorithms (DES,AES,Schnorr) but I have never used any complete library for it. I want to know what library...

Salting Your Password: Best Practices?

I've always been curious... Which is better when salting a password for hashing: prefix, or postfix? Why? Or does it matter, so long as you salt? To explain: We all (hopefully) know by now that we should salt a password before we hash it for storage in the database [Edit: So you can avoid things like what happened to Jeff Atwood recentl...

CryptExportKey in C#

What is the C# equivalent to this CryptExportKey call? CryptExportKey(hKey, hPublicKey, SIMPLEBLOB, 0, lpData, &nSize); and it would be nice if you can give a description on your C# code where hKey, hPublicKey and SIMPLEBLOB (or their equivalent in C#) are being used ...

Encrypted data size using RSA encryption (RSACryptoServiceProvider)

I need to use some encryption mechanism in one of the project I am working on. I was exploring RSA encryption and wrote some sample programs to learn. I understand that block size of RSA encryption is 16 bytes. So I gave the string "12345678" as input to below function: public static string Encrypt (string input) { var byteConvert...

.NET implementation (libraries) of elliptic curve cryptography

Please can you suggest any implementation of elliptical curve cryptography to be used on .NET platform? Also if you have used them, can you tell me the recommended curves that should be used? [EDIT] As @FatCat mentioned, its implementation is available in .NET framework 3.5 but that is only available on windows vista. Can you please s...

How could you encrypt user data so only they can decrypt it?

I was thinking about creating a Web app that would let people enter text (using SSL connection) and it would be encrypted before saving to the DB. The goal would be to have it so that only users could decrypt it. You could have the users enter the key along with their data, and enter it again when they want to see the data, and not stor...

Given a private key, is it possible to derive it's public key?

From whatever little I understand by reading various material, public-private key pair are the basis of assymetric encryption and also something about choosing 2 prime numbers (which is roughly your private key) and multiplying them (which is roughly your public key), I appears that it is possible to generate a public key if you know the...

How are public and private keys different?

I have a follow up question to Given a private key, is it possible to derive it’s public key? Are the public and the private keys the 'same' (in the sense that you just choose to make one public) or can you do more with the private key than with the public key? EDIT - to better state my question: When the two keys are generated, could...

Is AES a viable solution for creating a hash verification system?

I am writing a program that and like to implement data verification system. It needs to return a unique string for any value entered. My question boils down to: is it possible for an AES function to return the same value for two different entries? The source values will becoming from data held on a magnetic stripe card. more details ...

Managed SIMPLEBLOB blob doesn't match Unmanaged SIMPLEBLOB (RSA -Cryptography)

The simple blob that is generated using CryptExportKey(hKey, hPublicKey, SIMPLEBLOB, 0, lpData, &nSize); does not match the one generated from the following code (note that client.key is the plain text key value of hKey found using http://www.codeproject.com/KB/security/plaintextsessionkey.aspx ) CspParameters cspParams = new CspPa...

Which FIPS compatible algorithm is better in dotNet 2.0?

I used Rijndael algorithm to encrypt/decrypt my data. But it is not FIPS compatible. I want to change it to another one. Could you please give me a suggestion that which one is better? Better means: FIPS compatible High security level This algorithm should came from dotnet 2.0 framework which provided by Microsoft. Thanks -Jamebo ...

TripleDES: Specified key is a known weak key for 'TripleDES' and cannot be used.

I'm using the .NET 3.0 class System.Security.Cryptography.MACTripleDES class to generate a MAC value. Unfortunately, I am working with a hardware device that uses "1111111111111111" (as hex) as a single-length DES key. The System.Security.Cryptography library does some sanity checking on the key and returns a Exception if you try to us...

HMACMD5 in .net compact framework

How to implement HMACMD5 algorithm in .net compact framework. ...

Are there any other open source JCE libraries besides BouncyCastle?

I am looking for open source JCE libraries that implement some of the more esoteric encryption algorithms so that I can study their implementation. I would be especially interested in ones that implement Identity Based Encryption (IBE) as published by Stanford. ...

Minimize the info in a signature segment using RSACryptoServiceProvider

I have a XML file that looks like this <Licence> <Name>Test company</Name> <Version>1.1.1.1</Version> <NumberOfServer>2</NumberOfServer> </Licence> I then use a previous generated private key to sign the XML file using the foloowing code private void SignFile(XmlDocument doc) { SignedXml signedXml = new SignedX...

Would you be OK with this way of verify a license?

I have a XML file describing the name of the company the product is licensed for, the version and some extra information. Looking something like this <Licence> <Name>sdfsdf</Name> <Version>1.2.1.1</Version> <NumberOfServer>4</NumberOfServer> </Licence> I then sign this fiel using a private key and get <Licence> <Name>sdfsdf<...

Simple cryptography problem to be implemented in PHP

I need to implement a couple of functions which comply with the following: function genKey: given a string q (this may be a MD5 or SHA hash) and a seed string, the function must generate a new string p function checkKey: this function must return true if a string p was generated from string q (using the previous function) In seudo-...