Solved

Encrypting a CString

Posted on 2007-03-26
3
691 Views
Last Modified: 2013-12-04
Hi,
I want to be able to encrypt a CString. Since I am doing some application programming in MFC, I would like to use the CryptEncrypt() function. Can somebody show me how to use this function? The example in MSDN deals with encrpyting a file, but I need to just encrypt a string.
I don't need the encryption to be very complicated, just reasonably secure.

Thanks.
0
Comment
Question by:maloriopolium
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:yogesh28577
ID: 18797850
Here is    simple technique

      char szTemp[256];
      int nIdx;

      strcpy(szTemp, "INDIA");
      
      
      nIdx = 0;

      while (szTemp[nIdx] != 0)
      {
        szTemp[nIdx] ^= 21;
        nIdx++;
      }

      MessageBox ( szTemp);;
0
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 125 total points
ID: 18798303
0
 

Author Comment

by:maloriopolium
ID: 18806429
Thanks mahesh,

The codeproject link looks like what I need to figure out how to use the CryptEncrypt function.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question