473,659 Members | 3,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Protecting the code

22 New Member
Hi, I've written a code which I want to protect from misuse. I've created a shared lib of c++ code, now is it possible for someone to read function names inside?

Is it possible for someone to get a list of classes and crack the data flow system?

If yes, then how can I prevent this? what is the most secure method to do so.

Req is that I have to create the shared lib.
Also assume that others will get access to that shared lib.

Thanks
Oct 16 '07 #1
1 1238
weaknessforcats
9,208 Recognized Expert Moderator Expert
The library itself is in binary so no one can see the function names or the classes that you used.

Unless, of course, that you blabbed all in the header file you send out without your lib:
Expand|Select|Wrap|Line Numbers
  1. class jeet232
  2. {
  3.      private:
  4.         int data;
  5.      public:
  6.         int Fetch();
  7. };
  8.  
This class declaration is only needed by the code that uses the class. That is, by the source files of the lib itself

When you distribute, create a distribution header:
Expand|Select|Wrap|Line Numbers
  1. class Context;
  2. Context* GetCurrentContext();
  3. int GetData(Context*);
  4.  
and this is all the user sees. And this what the user codes:
Expand|Select|Wrap|Line Numbers
  1. Context* c = GetCurrentContext();
  2. int result = GetData(c);
  3.  
where:
Expand|Select|Wrap|Line Numbers
  1. Context* GetCurrentContext()
  2. {
  3.         //I'm just making things up to give you the idea
  4.         jeet232* temp = new jeet232;
  5.         Context* obj = new Context(temp);
  6.         return obj;
  7. }
  8.  
Here the Context class has a jeet232 member. The user works with Context* and the Context member functions interact with your other classes.

Context is an interface class and is intended to hide everything:
Expand|Select|Wrap|Line Numbers
  1. class Context
  2. {
  3.      private:
  4.         jeet232* TheContext;
  5.      public:
  6.         int GetData();
  7. };
  8. int Context::GetData()
  9. {
  10.     //be sure to check for safe pointer before using
  11.     return TheContext->Fetch();
  12. }
  13. //The user calls this one:
  14. int GetData(Context* arg)
  15. {
  16.     return arg->GetData();
  17. }
  18.  
Oct 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

24
5042
by: Yang Li Ke | last post by:
Hi guys! Anyone know a way so that users purchasing my scripts would not be able to share them with other people ? Yang
18
5719
by: Alan Sheehan | last post by:
Hi pythonistas, I am looking for methods of deploying applications with end users so that the python code is tamper proof. What are my options ? I understand I can supply .pyc or .pyo files but they can easily be reverse engineered I am told. Is it possible to load the scripts from zip files where the zip files are password protected ?
6
1983
by: nell | last post by:
Hi all, I've developed a testing application in python, and should supply it in a way that no one (lets say they are regular users) will understand it and edit it. The application source is all python but we expose a UI written in C# that go over all our code and expose to user functions (Indicated with a special prefix). So the problem on one hand is protecting the source and make it less accessible ond on the other hand to make it...
12
2190
by: Roland Hall | last post by:
I read Aaron's article: http://www.aspfaq.com/show.asp?id=2276 re: protecting images from linked to by other sites. There is a link at the bottom of that page that references an interesting article about ways of protecting your images from being downloaded. It was my understanding that if the client sees it, then it's in the client cache. Am I wrong in this belief or not? I took the information in the article and created the .asp that...
5
1897
by: John | last post by:
Dear all, I've got a security question that is so difficult that "maybe" there will be no answer for it. It's regarding protecting asp code. I did write some asp code, that I sell to companies, to control several dbases. Because I sell the code, it's not that they own the code and can sell it further or change the code, or add some extra code to it. It's like I'm selling a program like Excel and that they can use the program, not...
7
1454
by: Shawn | last post by:
Hi. I have a folder that contains a lot of different documents. xls, .doc, .pdf etc. Different users have access to different documents. The problem is that if a user knows the name of a document then he can just write the path into IE and get access to it anyway. Is it possible to prevent this? Thanks, Shawn
12
1935
by: Dr. Edmund M. Hayes | last post by:
I wrote a access program that works well enough that a handful of people would like to buy it from me. My problem is that if I sell it to someone there is no mechanism that I know of to protect them from giving it to anyone they feel like. The program produces reports that are specific to a particular organization but that does stop anyone from just modifying that report to make it specific to another organization, who they might have...
22
2609
by: flit | last post by:
Hello All, I have a hard question, every time I look for this answer its get out from the technical domain and goes on in the moral/social domain. First, I live in third world with bad gov., bad education, bad police and a lot of taxes and bills to pay, and yes I live in a democratic "state" (corrupt, but democratic). So please, don't try to convince me about the social / economical / open source / give to all / be open / all people are...
0
1131
by: xamman | last post by:
hi there! according to msdn (link at bottom) i should be able to protect a whole class declaratively as above. However i keep getting 'request for principal permissions failed' exceptions. in the msdn article a reference is made to include AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal) in your code to set the appdomain principal.I can understand how to use setprincipalpolicy to protect a method declaratively...
16
4198
by: rogerjames1 | last post by:
How would I go about protecting a whole directory, e.g. http://www.example.com/members/ and all sub-directories with login protection? I wouldn't like to put a .php script in each directory and I'd like to protect all file-types
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.