Sponsored Content
Top Forums Shell Programming and Scripting Gpg (GnuPG) encryption and decryption Post 303004523 by johnsnow on Tuesday 3rd of October 2017 05:22:48 PM
Old 10-03-2017
Gpg (GnuPG) encryption and decryption

Hi Friends,

There are some 7 years script in out linux server. I am trying to understand them since Linux Server changed(A).

Below line in one of the encrypting script. Here scenario is encrypting bank files in our (A) server and doing Secure Copy to Server (B).
Code:
 GPG -v --batch --yes --armor --passphrase SOMEPASSWORD --trust-model always --sign -r PublicKEY_VENDOR -o /app/test.asc app/test.txt

We generated GPG key ( Set the passphrase as SOMEPASSWORD)and shared public with B server owner.
PublicKEY_VENDOR is shared by B Server owner with us (Server A).
I have imported into our Server A.

Is the above code line is correct? why we are using SOMEPASSWORD? are we supposted to use passphrase of PublicKEY_VENDOR?

Your help is much appreciated.

Regards,
Babu
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File Encryption and Decryption in UNIX.

Hello guys ! I have used "crypt <first> second" command to encrypt "first" to "second" file. i have assign a key for that of course. Now when i try to look content of "seocnd" file through "cat second" command, the file is encrypted and cannot be read which is according to plan. But when... (3 Replies)
Discussion started by: abidmalik
3 Replies

2. Shell Programming and Scripting

GnuPG (gpg command)

I've been blessed with the task of writing functions that will be used to encrypt / decrypt data files using the Gnupg (gpg command) software on our Solaris 9. This was just installed last friday and I've got no documentation other than what I've found on the web. I was successful in writing... (4 Replies)
Discussion started by: BCarlson
4 Replies

3. Solaris

PGP encryption/decryption solaris 9

Hi Someone is going to send me a file that they have encrypted by PGP encryption on windows pc to my solaris 9 server. They will give me the pgp key to decrypt the file. How can I do this on solaris 9 Is there a tool installed by default to decrypt or do I need to install something to... (0 Replies)
Discussion started by: frustrated1
0 Replies

4. Solaris

Public keys for GPG Encryption

HI, I'm trying to encrypt a file and i'll FTP it to a external server.When i encrypt it using the command gpg -e -r 'recipient name' <filename> its asking me for public keys.Is there a way to encrypt without having to give the public keys? or if i need to give public keys i... (1 Reply)
Discussion started by: James777
1 Replies

5. UNIX for Dummies Questions & Answers

Identify a file for encryption or decryption

Dear Members, Can we find if a particular file is encrypted or decrypted. I need a command by which i should be able to identify if a file is encrypted or decrypted. How can we do this? (1 Reply)
Discussion started by: sandeep_1105
1 Replies

6. Shell Programming and Scripting

Need help on File Encryption using gpg

Folks, Is there anyone to help on GPG file encryptions here. I got a public key from third party. I imported the key in server. I want to encrypt the public key. But without being signed , the key cannot be encrypted. When I try to sign the key using lsign command, I am getting the below... (1 Reply)
Discussion started by: dinesh1985
1 Replies

7. Solaris

GPG encryption utility in Solaris 10

Hi All, I am working on Solaris 10 OS on X4170M2 server. I have some .gpg encrypted files and i want to decrypt them but i dont know how to install the binary of gpg. Here is the binary in system : root@ecmstest # ls -larth total 1273904 -rw-r--r-- 1 root root 3.5M Oct 14 ... (1 Reply)
Discussion started by: Deepa Jain
1 Replies

8. Shell Programming and Scripting

String encryption and decryption

Hello All, There are so many questions on this and I didn't find any concluded answer. I want to encrypt a string in the script, actually this is a password. I tried using openssl (I am a newbie to openssl), but it is generating a long one which we can't remember. I want to encrypt the... (5 Replies)
Discussion started by: karumudi7
5 Replies

9. Ubuntu

help regarding encryption and decryption of files on linux

we are to develope a project on linux whose aim is to automatically encrypt files after logoff and to decrypt them using password after log in this is to be made by chging source code of linux ........... can any one help me on this???? (1 Reply)
Discussion started by: vyom
1 Replies

10. UNIX for Advanced & Expert Users

GPG encryption error ...

Hi. I'm hitting issues using gpg to encrypt a text file on Linux. gpg -c --passphrase 123 --cipher-algo AES256 test gpg: cancelled by user gpg: error creating passphrase: Operation cancelled gpg: symmetric encryption of `test' failed: Operation cancelled In this case the file test just... (3 Replies)
Discussion started by: user052009
3 Replies
Net::Server::PSGI(3)					User Contributed Perl Documentation				      Net::Server::PSGI(3)

NAME
Net::Server::PSGI - basic Net::Server based PSGI HTTP server class TEST ONE LINER
perl -e 'use base qw(Net::Server::PSGI); main->run(port => 8080, ipv => "*")' # runs a default echo server SYNOPSIS
use base qw(Net::Server::PSGI); __PACKAGE__->run(app => &my_echo_handler); # will bind IPv4 port 80 sub my_echo_handler { my $env = shift; my $txt = qq{<form method="post" action="/bam"><input type="text" name="foo"><input type="submit"></form> }; require Data::Dumper; local $Data::Dumper::Sortkeys = 1; require CGI::PSGI; my $form = {}; my $q = CGI::PSGI->new($env); $form->{$_} = $q->param($_) for $q->param; $txt .= "<pre>".Data::Dumper->Dump([$env, $form], ['env', 'form'])."</pre>"; return [200, ['Content-type', 'text/html'], [$txt]]; } DESCRIPTION
If you want a more fully featured PSGI experience, it would be wise to look at the Plack and Starman set of modules. Net::Server::PSGI is intended as an easy gateway into PSGI. But to get the most out of all that PSGI has to offer, you should review the Plack and Plack::Middleware. If you only need something a little more rudimentary, then Net::Server::PSGI may be good for you. Net::Server::PSGI takes Net::Server::HTTP one level farther. It begins with base type MultiType defaulting to Net::Server::Fork. It is easy to change it to any of the other Net::Server flavors by passing server_type => $other_flavor in the server configurtation. The port has also been defaulted to port 80 - but could easily be changed to another through the server configuration. You can also very easily add ssl by including, proto=>"ssl" and provide a SSL_cert_file and SSL_key_file. For example, here is a basic server that will bind to all interfaces, will speak both HTTP on port 8080 as well as HTTPS on 8443, and will speak both IPv4, as well as IPv6 if it is available. use base qw(Net::Server::PSGI); __PACKAGE__->run( port => [8080, "8443/ssl"], ipv => '*', # IPv6 if available SSL_key_file => '/my/key', SSL_cert_file => '/my/cert', ); METHODS
"process_request" This method has been overridden in Net::Server::PSGI - you should not use it while using Net::Server::PSGI. This overridden method parses the environment and sets up request alarms and handles dying failures. It calls process_psgi_request once the request is ready and headers have been parsed. "process_psgi_request" Used when psgi_enabled is true. During this method, find_psgi_handler will be called to return the appropriate psgi response handler. Once finished, print_psgi_headers and print_psgi_body are used to print out the response. See PSGI. Typically this method should not be overridden. Instead, an appropriate method for finding the app should be given to find_psgi_handler or app. "find_psgi_handler" Used to lookup the appropriate PSGI handler. A reference to the already parsed $env hashref is passed. PATH_INFO will be initialized to the full path portion of the URI. SCRIPT_NAME will be initialized to the empty string. This handler should set the appropriate values for SCRIPT_NAME and PATH_INFO depending upon the path matched. A code reference for the handler should be returned. The default find_psgi_handler will call the "app" method. If that fails a reference to the psgi_echo_handler is returned as the default application. sub find_psgi_handler { my ($self, $env) = @_; if ($env->{'PATH_INFO'} && $env->{'PATH_INFO'} =~ s{^ (/foo) (?= $ | /) }{}x) { $env->{'SCRIPT_NAME'} = $1; return &foo_app; } return $self->SUPER::find_psgi_handler($env); } "app" Return a reference to the application being served. This should be a valid PSGI application. See PSGI. By default it will look at the value of the "app" configuration option. The "app" method may also be used to set the "app" configuration option. package MyApp; use base qw(Net::Server::PSGI); sub default_server_type { 'Prefork' } sub my_app { my $env = shift; return [200, ['Content-type', 'text/html'], ["Hello world"]]; } MyApp->run(app => &my_app); # OR sub app { &my_app } MyApp->run; # OR my $server = MyApp->new; $server->app(&my_app); $server->run; OPTIONS
In addition to the command line arguments of the Net::Server::HTTP base classes you can also set the following options. app Should return a coderef of the PSGI application. Is returned by the app method. AUTHOR
Paul T. Seamons paul@seamons.com SEE ALSO
Please see also Plack, Starman, Net::Server::Fork, Net::Server::INET, Net::Server::PreFork, Net::Server::PreForkSimple, Net::Server::MultiType, Net::Server::Single Net::Server::SIG Net::Server::Daemonize Net::Server::Proto Net::Server::HTTP perl v5.16.2 2012-06-11 Net::Server::PSGI(3)
All times are GMT -4. The time now is 01:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy