How do I securely get data transferred from C to Perl?
NickName:user5074403 Ask DateTime:2015-08-20T05:17:25

How do I securely get data transferred from C to Perl?

Suppose I have a perl program such as:

my $c = "MyDataToCProg";
open my $h, '-|', 'myCProg', "$c";
my @result = <$h>;
close $h;
print "Result: " . $result[0] . "\n";

Now, myCProg is a program compiled with gcc. The C program's output would be a printf statement which would end up in the perl program's $result[0] variable.

Is there a better way to extract output out of a C program than through printing with printf? For example, anyone could also run 'myCProg' from the command line and also see output. I want the output to only be seen in the perl program an NOT viewable if someone ran the program at the command line.

Anyone know how to do this?

Sorry, I don't have a C Program handy, but anything that has a printf statement (even a simple Hello World) and takes an argument (maybe prints "Hello [yourname]" would work for this example.

Copyright Notice:Content Author:「user5074403」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/32105815/how-do-i-securely-get-data-transferred-from-c-to-perl

More about “How do I securely get data transferred from C to Perl?” related questions

How do I securely get data transferred from C to Perl?

Suppose I have a perl program such as: my $c = "MyDataToCProg"; open my $h, '-|', 'myCProg', "$c"; my @result = &lt;$h&gt;; close $h; print "Result: " . $result[0] . "

Show Detail

How Is My Password Transferred from My Browser to the Web Server Securely?

How is the password I enter in, say a Gmail login form, transferred to the web server securely? What does the browser or any client application do? What does the web server do?

Show Detail

Securely storing user data in MySQL?

I'm creating a service that will gather user data such as username, name, email, login password. How do I securely store this data? One thing I was thinking is store it encrypted in the DB so that if

Show Detail

How to securely transfer on-premise data to GCS buckets daily

What is the best way to securely transfer data to GCS bucket from on-premise. Data size in 10GBs to transferred daily to GCS buckets. Data is lying on my on-premise server in my organisation. Is ...

Show Detail

Sending data from c to perl

I need to send some data from c program to Perl program that both in running mode (Perl program in sleep mode and c program running, and c program sends data to Perl). I know that, can write this

Show Detail

How do I program a CGI script to execute a remote script over ssh and display data from the remote execution?

I have this particular case where I have to place the HTML pages and CGI scripts on ServerA and the CGI scripts will have to invoke Perl scripts on ServerB which will fetch data from a DB and the H...

Show Detail

How to securely send content from non-secure page to a secure URL?

I have a JavaScript snippet that is aimed to be embedded into any webpage. This snippet loads a form into the page it's embedded in. The snippet then sends the form data to a secure URL. Here is the

Show Detail

How do I securely hide database credential in C# application?

I have a situation that users access remote MySQL server in C# application. Basically, A user using C# application on his/her desktop ->>>> connects to remote ->>>>>>>> [ REMOTE ] How do I sec

Show Detail

Securely storing data, how do apps do it?

I'm doing some research on a new project we want to work on, but before we actually take on the project I have some concerns. This project involves storing a lot of (text) data somewhere on a serv...

Show Detail

How to get returned data from mongoDB in Perl?

I read http://api.mongodb.org/perl/current/MongoDB/Examples.html and seems to be only documentation from mongoDB on Perl. How do I get my query result from mongoDB in perl. Let us say into Hash. I ...

Show Detail