[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

code/array is visible to user & icon

Hi, I opened up my c program in notepad and found that I could see some text that I don't want the user to see.  It's text in one of my arrays.  Is there a way to make my whole code invisible to the user?

My other question is, how do I create my own icon and use it for my c programs?  Don't like the default icon.

  • 3
  • 2
2 Solutions
Jaime OlivaresSoftware ArchitectCommented:
There are many cryptographic techniques but simplest one is the Caesar algorithm. So you just have to "shift" alphabet, so A=D, B=E, C=F, etc.
Replace you strings with transposed alphabet and before using array into your program, run the decyphering algorithm over the array.
To create an Icon, just use an Icon Editor, there are many at www.download.com
greyknight17Author Commented:
Hi jaime, I actually did read something about this.  So just assign the letter (variable in this case) to another letter?  How would I do this without overlapping each other?  Any program that will make this process more easier?

I know how to create the icon, I want to know how to associate it with my c program.  I don't like the default exe icon.
Jaime OlivaresSoftware ArchitectCommented:
Just have to create you own cyphering and decyphering algorithms, cyphering could be a separated tool you can use any time to input a string and obtaining a "cyphered" string you can copy and paste into your source code. Decyphering algorithm must be into your application. Use any algorithm you want, simple or complex.
To create a simple sustitution algoritm just have to create a constant array with 256 values with  sustituted characters, so you can make a cyphering algorithm like this:

for (i=0; buffer[i]; i++)
    buffer[i] = CYPHER[buffer[i]];

where CYPHER is the array mentioned, something like:

char CYPHER[256] = {
        0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,   /* no sustitution for first characters */
        35,52,86,36,29, ......etcetera
Managing Security & Risk at the Speed of Business

Gartner Research VP, Neil McDonald & AlgoSec CTO, Prof. Avishai Wool, discuss the business-driven approach to automated security policy management, its benefits and how to align security policy management with business processes to address today's security challenges.

To set an icon to a window you can use the SendMessage function; send a WM_SETICON to a window.
check out MSDN:

this assumes you already know hot to import an icon as a resource: you have to add a line ICON to you .rc file, with the icons path and name. it can also be done using the compiler (Visual C++ 6.0: Import resource)
greyknight17Author Commented:
Thanks stuart for the icon link.  I will take a look at that.

Still having trouble with the cypering though.

I have a dynamic array:

char myarr * []={......

How do I do this then?
greyknight17Author Commented:
I will close this question now since there seems to be no more replies now.

Having a problem with both the icon setting (can't figure out how to link an icon to the program and also can't get the cyphering code to work.  I will close it anyway and split 25 pts for both.


Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now