Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-02

Send a ResultSet (encrypted) between 2 servers

17 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marcos Douglas

Hi,
If you had to send an encrypted ResultSet between 2 DBMS servers, using port 80, what libs would you use?
It isn't necessary to use WebServices. Just two applications sending encrypted packages...

Marcos Douglas

Reply by email

Graeme Geldenhuys
to Marcos Douglas

Op 2011-02-10 01:28, Marcos Douglas het geskryf:

If you had to send an encrypted ResultSet between 2 DBMS servers, using port 80, what libs would you use?

Blowfish comes to mind. There is an implementation included with FPC, or you can use the more extensive DCPCrypt package. We use the latter for our encryption needs.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Marcos Douglas
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
Op 2011-02-10 01:28, Marcos Douglas het geskryf: > If you had to send an encrypted ResultSet between 2 DBMS servers, > using port 80, what libs would you use? Blowfish comes to mind. There is an implementation included with FPC, or you can use the more extensive DCPCrypt package. We use the latter for our encryption needs.

Right... and about the way to send these ResultSet packages, what would you use?

My problem is:
A site, coded in (old) ASP, will use a ActiveX app to communicate with an app in other server (my future app). This app will execute some SELECTs in a DBMS. The result (ResultSet) will be encrypted, compressed and sent to ActiveX app. This descompress, decrypts and save the ResultSet in your own DBMS.

Marcos Douglas

Reply by email

Joost van der Sluis
to Marcos Douglas: If you had to send an encrypted ResultSet between 2 DBMS servers, using port 80, what…
Marcos Douglas wrote 5 lines
Hi, If you had to send an encrypted ResultSet between 2 DBMS servers, using port 80, what libs would you use? It isn't necessary to use WebServices. Just two applications sending encrypted packages...

I also read your more recent message. But what do you think 'webservices' do? Sending data between two applications using port 80 is exactly what webservices do. So you can not solve your problem without using webservices by definition.

You can solve this the difficult way (I think this is what you mean) using your own protocol and any tcp/ip-component. Like lNet, Indy or Synapse. The protocol could be as simple as this: do a request to some url, and get the dataset back, encrypted. In fact you have then build your own webservice.

But the easier way is to use some pre-defined format (xml=soap, or json, or whatever) so you can use some standard components. But I think that this is not what you want, as you stated you don't want to use 'webservices'.

Joost.

Reply by email

Graeme Geldenhuys
to Marcos Douglas: On Thu, Feb 10, 2011 at 3:32 AM, Graeme Geldenhuys Right... and about the way to send…

Op 2011-02-10 12:43, Marcos Douglas het geskryf:

Right... and about the way to send these ResultSet packages, what would you use?

I don't know how others implement n-tier apps with FPC, but I would probably us something as implemented in tiOPF [http://www.tiopf.com], seeing that we already use tiOPF for all our object persistence. We don't currently use n-tier apps at work, our encryption is inside a client app reading encrypted content from a file and feeding it to a Flash component.

It would be nice if somebody could post a wiki link, or create a short wiki article if one doesn't exist yet - and showing how n-tier apps can be implemented using FPC (and not with tiOPF). I have seen this question asked numerous times over the years of using FPC. Is WebServices the only option available to FPC developers, or is there something like Delphi's Midas too?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Marcos Douglas
to Joost van der Sluis: I also read your more recent message. But what do you think 'webservices' do? Sending…
Joost van der Sluis wrote 17 lines
On Wed, 2011-02-09 at 21:28 -0200, Marcos Douglas wrote: > Hi, > If you had to send an encrypted ResultSet between 2 DBMS servers, > using port 80, what libs would you use? > It isn't necessary to use WebServices. Just two applications sending > encrypted packages... I also read your more recent message. But what do you think 'webservices' do? Sending data between two applications using port 80 is exactly what webservices do. So you can not solve your problem without using webservices by definition. You can solve this the difficult way (I think this is what you mean) using your own protocol and any tcp/ip-component. Like lNet, Indy or Synapse. The protocol could be as simple as this: do a request to some url, and get the dataset back, encrypted. In fact you have then build your own webservice.

I want simplify!
I said: "It isn't necessary to use WebServices. Just two applications sending encrypted packages..."
Not _necessary_ because I think should exists solutions more simpler than WebServices and yours XML files.

But the easier way is to use some pre-defined format (xml=soap, or json, or whatever) so you can use some standard components. But I think that this is not what you want, as you stated you don't want to use 'webservices'.

I can use XML, SOAP, JSON, whatever... I asked "what libs would you use?" for this problem.
I not want THE solution (well... I accept if you give me!), but if somebody had the same problem, could tell: "use the 'lib X' to communicate, 'lib Y' to convert a ResultSet to Stream and 'lib Z' to encrypt all... see an example in the link 'XYZ.com'" or something like that =)

Marcos Douglas

Reply by email

Marcos Douglas
to Graeme Geldenhuys: Op 2011-02-10 12:43, Marcos Douglas het geskryf: I don't know how others implement n-tier…
Graeme Geldenhuys wrote 17 lines
Op 2011-02-10 12:43, Marcos Douglas het geskryf: > > Right... and about the way to send these ResultSet packages, what would you use? I don't know how others implement n-tier apps with FPC, but I would probably us something as implemented in tiOPF [http://www.tiopf.com], seeing that we already use tiOPF for all our object persistence. We don't currently use n-tier apps at work, our encryption is inside a client app reading encrypted content from a file and feeding it to a Flash component. It would be nice if somebody could post a wiki link, or create a short wiki article if one doesn't exist yet - and showing how n-tier apps can be implemented using FPC (and not with tiOPF). I have seen this question asked numerous times over the years of using FPC. Is WebServices the only option available to FPC developers, or is there something like Delphi's Midas too?

+1

See, Joost, not all are WebService. I forgot the Delphi Midas, simpler than WebServices, not?

Marcos Douglas

Reply by email

Graeme Geldenhuys
to Marcos Douglas

Op 2011-02-10 14:11, Marcos Douglas het geskryf:

I forgot the Delphi Midas, simpler than WebServices, not?

I have never used WebServices in any project before, but the little bit that I read about the topic (using FPC, Java or .NET) seems very confusing - compared to Delphi's Midas solution.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Joost van der Sluis
to Marcos Douglas: On Thu, Feb 10, 2011 at 7:56 AM, Graeme Geldenhuys +1 See, Joost, not all are WebService.…
Marcos Douglas wrote 24 lines
On Thu, Feb 10, 2011 at 7:56 AM, Graeme Geldenhuys wrote: > Op 2011-02-10 12:43, Marcos Douglas het geskryf: >> >> Right... and about the way to send these ResultSet packages, what would you use? > > I don't know how others implement n-tier apps with FPC, but I would > probably us something as implemented in tiOPF [http://www.tiopf.com], > seeing that we already use tiOPF for all our object persistence. We > don't currently use n-tier apps at work, our encryption is inside a > client app reading encrypted content from a file and feeding it to a > Flash component. > > It would be nice if somebody could post a wiki link, or create a short > wiki article if one doesn't exist yet - and showing how n-tier apps can > be implemented using FPC (and not with tiOPF). I have seen this question > asked numerous times over the years of using FPC. Is WebServices the > only option available to FPC developers, or is there something like > Delphi's Midas too? +1 See, Joost, not all are WebService. I forgot the Delphi Midas, simpler than WebServices, not?

Midas is a web-service. (At least when is uses port 80)

But if you want to use something Midas-like, you can just build it yourself, as I wrote before.

Load the data into a TBufDataset. Then write the data to a stream. (You may choose the format: xml (midas-compatible) or binary) Then encode that stream, and send it using tcp/ip.

If you want to know what packages you need for this:

Database: sqldb
Encoding: choose whatever you want, Graeme mentioned Blowfish tcp/ip: choose whatever you want, I mentioned lNet, Synapse and Indy

Further it's easy:

You need a server, which listens to port 80 (use Indy, lNet, Synapse) and when it retrieves data decrypt is, and load it into a TBufDataset using a stream.

And you need a client, which loads the data from a TBufDataset, encrypt it and opens a connection to the server on port 80 (use Indy, lNet, Synapse) and sends the data.

This is what Midas does for you. If you don't want to use an existing WebService, you have to code this yourself.

Joost

Reply by email

Marcos Douglas
to Graeme Geldenhuys: Op 2011-02-10 14:11, Marcos Douglas het geskryf: I have never used WebServices in any…
Graeme Geldenhuys wrote 8 lines
Op 2011-02-10 14:11, Marcos Douglas het geskryf: > > I forgot the Delphi Midas, simpler than WebServices, not? I have never used WebServices in any project before, but the little bit that I read about the topic (using FPC, Java or .NET) seems very confusing - compared to Delphi's Midas solution.

That's I'm talking about.
I used WebServers a long time ago (people said: "this is the future", "everbody will use", blablabla) and I still thinking is very confusing.
I don't like XML, used Delphi 7. Some clients (coded in others languages) haven't got the WS's returns very well... problem with arrays of objetcts, e.g.

Using Midas, I did not have these problems. Is very simple: implements a new method in the server and use it in the client.

Marcos Douglas

Reply by email

Marcos Douglas
to Joost van der Sluis: Midas is a web-service. (At least when is uses port 80) But if you want to use something…
Joost van der Sluis wrote 15 lines
Midas is a web-service. (At least when is uses port 80) But if you want to use something Midas-like, you can just build it yourself, as I wrote before. Load the data into a TBufDataset. Then write the data to a stream. (You may choose the format: xml (midas-compatible) or binary) Then encode that stream, and send it using tcp/ip. If you want to know what packages you need for this: Database: sqldb Encoding: choose whatever you want, Graeme mentioned Blowfish tcp/ip: choose whatever you want, I mentioned lNet, Synapse and Indy

Many tips, thanks.

Show quoted text 12 lines
Further it's easy: You need a server, which listens to port 80 (use Indy, lNet, Synapse) and when it retrieves data decrypt is, and load it into a TBufDataset using a stream. And you need a client, which loads the data from a TBufDataset, encrypt it and opens a connection to the server on port 80 (use Indy, lNet, Synapse) and sends the data. This is what Midas does for you. If you don't want to use an existing WebService, you have to code this yourself.

You think I shouLd use WebService. How is this implementation in FPC, stable or is better do this in Delphi 7? (if I will use WebService).

Marcos Douglas

Reply by email

Joost van der Sluis
to Marcos Douglas
Marcos Douglas wrote 34 lines
On Thu, Feb 10, 2011 at 9:57 AM, Joost van der Sluis wrote: > > Midas is a web-service. (At least when is uses port 80) > > But if you want to use something Midas-like, you can just build it > yourself, as I wrote before. > > Load the data into a TBufDataset. Then write the data to a stream. (You > may choose the format: xml (midas-compatible) or binary) > Then encode that stream, and send it using tcp/ip. > > If you want to know what packages you need for this: > > Database: sqldb > Encoding: choose whatever you want, Graeme mentioned Blowfish > tcp/ip: choose whatever you want, I mentioned lNet, Synapse and Indy Many tips, thanks. > Further it's easy: > > You need a server, which listens to port 80 (use Indy, lNet, Synapse) > and when it retrieves data decrypt is, and load it into a TBufDataset > using a stream. > > And you need a client, which loads the data from a TBufDataset, encrypt > it and opens a connection to the server on port 80 (use Indy, lNet, > Synapse) and sends the data. > > This is what Midas does for you. If you don't want to use an existing > WebService, you have to code this yourself. You think I shouLd use WebService. How is this implementation in FPC, stable or is better do this in Delphi 7? (if I will use WebService).

You have to use a webservice by definition. You could use wst, but that's overkill. But to be honest: in your case I think it's indeed better to use something home-made.

I know that others also had problems like these. Adding something like Midas is on my todo-list for a long time.

We can try to build the basic blocks you need so that it works for you. Thereafter we can (maybe that MvC can help) design a structure to make it more general.

First step is to export the data from a TBufDataset to a stream. See if you can do that and report back. Do you already use sqldb to obtain your data?

Joost.

Reply by email

Paulo Costa
to Marcos Douglas: On Thu, Feb 10, 2011 at 3:32 AM, Graeme Geldenhuys Right... and about the way to send…
Marcos Douglas wrote 6 lines
My problem is: A site, coded in (old) ASP, will use a ActiveX app to communicate with an app in other server (my future app). This app will execute some SELECTs in a DBMS. The result (ResultSet) will be encrypted, compressed and sent to ActiveX app. This descompress, decrypts and save the ResultSet in your own DBMS.

Just a side note:
You should compress first and then encrypt. The encrypted data is hard to compress so it is better to do the compression first, over the data that is more amenable to be compressed.

Paulo Costa

Reply by email

Alexsander Rosa
to Marcos Douglas: If you had to send an encrypted ResultSet between 2 DBMS servers, using port 80, what…

I would suggest to do the encryption/decryption in the peers, using plain text (after some plain-text encoding like base64) for the communication. Then you could do a simple SELECT to move the resultset around.

2011/2/9 Marcos Douglas

Show quoted text 14 lines
Hi, If you had to send an encrypted ResultSet between 2 DBMS servers, using port 80, what libs would you use? It isn't necessary to use WebServices. Just two applications sending encrypted packages... Marcos Douglas -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Atenciosamente, Alexsander da Rosa http://rednaxel.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110210/d12851ed/attachment.html>

Reply by email

Marcos Douglas
to Joost van der Sluis: You have to use a webservice by definition. You could use wst, but that's overkill. But…
Joost van der Sluis wrote
You have to use a webservice by definition. You could use wst, but that's overkill. But to be honest: in your case I think it's indeed better to use something home-made.

Uau! There is a loooong WST wiki page:
http://wiki.freepascal.org/Web_Service_Toolkit
if you think that's overkill, I following your advice!

I know that others also had problems like these. Adding something like Midas is on my todo-list for a long time.

Very good!

We can try to build the basic blocks you need so that it works for you. Thereafter we can (maybe that MvC can help) design a structure to make it more general.

OK. I will work on that in the next week, when the project will be approved (I wait).

First step is to export the data from a TBufDataset to a stream. See if you can do that and report back. Do you already use sqldb to obtain your data?

I have not begun the project.
Sincerely I was thinking to use Delphi 7, because this project have ActiveX objects. I don't know how is this implementation in the FPC so... but I wanted do all in FPC, if is possible.

Maybe not be need to use TBufDataset... this project will be coded with another person, a DBA. I think is better the SP's result return the SQL instructions (insert table blblabla) to use directly in the receptor. The app not need to know about these tables.

Marcos Douglas

Reply by email

Unknown author
to Joost van der Sluis: You have to use a webservice by definition. You could use wst, but that's overkill. But…
Joost van der Sluis wrote 7 lines
> > You think I shouLd use WebService. How is this implementation in FPC, > stable or is better do this in Delphi 7? (if I will use WebService). You have to use a webservice by definition. You could use wst, but that's overkill. But to be honest: in your case I think it's indeed better to use something home-made.

Well, WST is very easy to use, and is meanwhile fully integratable with fpWeb, so that should be a real breeze...

Show quoted text 6 lines
I know that others also had problems like these. Adding something like Midas is on my todo-list for a long time. We can try to build the basic blocks you need so that it works for you. Thereafter we can (maybe that MvC can help) design a structure to make it more general.

Well, you need a resolver object which basically does what SQLDb already does. Then you can wrap that object in a webservice (using WST or not).

Michael.

Reply by email