LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-22-2014, 05:42 PM   #1
g_paschoal
Member
 
Registered: Oct 2009
Posts: 131

Rep: Reputation: 15
Remote API ? service ? I need help


Hi guys,

I have a third party library ".so" on ubuntu 32 bits where I can import it to my code. This lib is an OCR for vehicles. It takes a car image as parameter and return the plate number of the car in text format.

My boss now is selling this product and we can't install it on customer computer because they might steal the lib from us.

So what I am thinking is a online solution where user can our server. So we might need to provide a remote API to the client and he can use it on their end.

Is it possible to do such thing ? I am not too experience on remote apis. But what is the initial steps to start taking a look at this and getting familiar on what is possible or not.

Comunication might be done via sockts (IP + port) and the software running on that port will do the OCR work.

How can I achieve such thing ?

Thank You
 
Old 04-23-2014, 09:52 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by g_paschoal View Post
Hi guys,
I have a third party library ".so" on ubuntu 32 bits where I can import it to my code. This lib is an OCR for vehicles. It takes a car image as parameter and return the plate number of the car in text format.

My boss now is selling this product and we can't install it on customer computer because they might steal the lib from us.
If it's a 'third party' library, that means you got it from someone else...so why are you concerned about someone stealing it from YOU, when you don't own it???
Quote:
So what I am thinking is a online solution where user can our server. So we might need to provide a remote API to the client and he can use it on their end. Is it possible to do such thing ? I am not too experience on remote apis. But what is the initial steps to start taking a look at this and getting familiar on what is possible or not.

Comunication might be done via sockts (IP + port) and the software running on that port will do the OCR work.
Similar to another question you posted:
http://www.linuxquestions.org/questi...ux-4175486491/

Short answer is, again: you CANNOT, EVER, 100% protect your software from being stolen. If someone can USE it, they can COPY it...what do you think will happen even IF your idea works? Are you going to put that API somewhere else too? How will you protect THAT?
 
Old 04-23-2014, 10:32 AM   #3
g_paschoal
Member
 
Registered: Oct 2009
Posts: 131

Original Poster
Rep: Reputation: 15
TB0ne, I have bought this .so library from a software company and we paid a lot of money. That's why we need to protect it.

And, my question still. How can make a service in linux ? Make a program listen on determined port and provide this service remotely.

This is a different question.

Thanks
 
Old 04-23-2014, 10:37 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i dont know much about your environment but generically you can have the clients scp the pic to your server; your server will ocr it; then the client will scp the result back.
 
Old 04-23-2014, 10:57 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
If it were me, I would do whatever the application requires ... before your competition serves the customer better than you did. Write a contract which strictly specifies the terms under which the application (including the library) may and may not be used. If they "steal it from you," you can then go after them. The principal consideration here, in my mind, is how to serve the customer best ... and that, it seems likely to me, would be to have the library available right there. Transmission times and so-forth might cost you.
 
2 members found this post helpful.
Old 04-23-2014, 11:09 AM   #6
g_paschoal
Member
 
Registered: Oct 2009
Posts: 131

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by schneidz View Post
i dont know much about your environment but generically you can have the clients scp the pic to your server; your server will ocr it; then the client will scp the result back.
I understand your point. I could also use database to share results with the customer. However I want something more professional. For example a service listing on some port. I need a way to provide this service remotely.

I think I need to use sockets but I don't know how to start. That's why I am asking you guys here.

I will have it installed on a machine that will be "the server" and my customer will have the "client" on their end.

I found this tutorial here

http://www.codeproject.com/Articles/...-tutorial-in-C

I will take a look to see if I can use this on my project.
Thanks
 
Old 04-23-2014, 12:17 PM   #7
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Simplest way is to set up a web server. Send a form POST request with the image and the customer key, return HTML containing the result. This makes it easy to set up and debug and you don't have to write a lot of infrastructure. There are existing libraries to generate and parse HTML. Use auth if you want to restrict access. The web logs will also tell you whether only your paying customers are using the software.
 
Old 04-23-2014, 12:49 PM   #8
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
Well, whatever you do, be sure to use some kind of authentication... And I would go with the secure transfer..

Fortunetly, what you ask is possible in a number of different ways (for example, using an API written in PHP, with a PHP module written in C that connects to your library, or a fastGCI program directly written in C -- the client-server communication could be done over HTTPS on an unusual port.. Authentication could be OAuth based),..
Since you know so little about networking, I would avoid writing a server from scratch.. You'll hit a lot of brick walls when you deploy it..

Anyway, anything you choose at this point means you have to write a bit.. And since that library is not open-source, I doubt you'll find anything related to it open-sourced..

Last edited by Smokey_justme; 04-23-2014 at 12:52 PM.
 
Old 04-23-2014, 12:54 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by g_paschoal View Post
TB0ne, I have bought this .so library from a software company and we paid a lot of money. That's why we need to protect it.
Unless you purchased the source code and ALL rights to it, then IT IS NOT YOURS. That third-party retains the license, unless you purchased it.
Quote:
And, my question still. How can make a service in linux ? Make a program listen on determined port and provide this service remotely.
This is a different question.
You can do it through sockets, but again, THERE IS NO WAY TO PROVIDE 100% protection, what you're trying to do is pointless, overly complicated, and will only serve to annoy your end-users. You only have to take a look at the crap Apple, Microsoft, and others have done in this arena...they've had decades and billions of dollars, and there are STILL pirated versions of their software around. And the end-users get more and more annoyed.

How happy do you think your users will be if your API doesn't work? Is buggy? If they have a connection issue back to you?? Do you think that they'll be thrilled that they spent money for your product, to have it not work reliably?
 
Old 04-23-2014, 01:02 PM   #10
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
This is a pretty simple set up. Its common.

And yes, the code on your machine will be invisible to the customer. There are many services I work with that do this kind of thing in the car industry.

What you want is a website, with a customer login, that takes an image upload, passes it to your program, then takes the results and sends it to the customer. The customer never needs to see, touch or know about the background process you are using.

As long as you take precautions to secure your website and network, you will be as protected as you can be while offering a service to the customer.
 
Old 04-23-2014, 01:56 PM   #11
g_paschoal
Member
 
Registered: Oct 2009
Posts: 131

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by smallpond View Post
Simplest way is to set up a web server. Send a form POST request with the image and the customer key, return HTML containing the result. This makes it easy to set up and debug and you don't have to write a lot of infrastructure. There are existing libraries to generate and parse HTML. Use auth if you want to restrict access. The web logs will also tell you whether only your paying customers are using the software.
I liked this solution. Seems to be very close to what I was looking for, thanks for the help.
Let me google it more and see what I can find. Thanks

Do you have site or tutorial so I can get started ? Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script for testing gss-api denial of service vulnerability in openssh pk_563 Linux - Security 1 02-01-2012 10:04 AM
script for testing openssh denial of service via gss-api pk_563 Linux - Newbie 2 02-01-2012 10:04 AM
script for testing gss-api denial of service vulnerability in openssh pk_563 Linux - Security 0 02-01-2012 03:14 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration