Sponsored Content
Operating Systems Solaris Solaris 10 encrypt command: can't use heredocs Post 302352052 by fixit9660 on Thursday 10th of September 2009 09:20:20 AM
Old 09-10-2009
Solaris 10 encrypt command: can't use heredocs

I'm trying to use the Solaris 10 "encrypt" command in a script. I want to encrypt a file called "database", but not using a keyfile, instead using a keyphrase. Running this from the cli requests the user to input "Enter key:" which is fair enough but I want to run this from a script. I've tried using heredocs but it doesn't work, always displaing the "Enter key:" request.

This is what I've got so far:

encrypt -a aes -i /database <<EncryptionKey
fredbloggs
EncryptionKey
chmod 400 /database

Anyone help please?

Thanks

Andy.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Encrypt traffic between Solaris 8 hosts

I have two Solaris 8 hosts that send data to one another throughout the day. It is a legacy system and the programs used are rdist, rcp and ftp. I have been asked to ensure that the data transferred is encrypted beween the two hosts. My first thought was to replace these commands with ssh.... (2 Replies)
Discussion started by: blp001
2 Replies

2. Programming

Help with encrypt function

Hi there, I need to include a simple encryption function in a C program and I came across this function void encrypt(char block, int edflag) whic is defined in #include des_crypt.h. According the man "the block argument to encrypt() is a character array of length 64 containing only the... (1 Reply)
Discussion started by: giggi
1 Replies

3. Shell Programming and Scripting

Tr utility to Encrypt

I need some help.. I would like to make a script that uses the tr utility to "encrypt" a selected file. I need to know how to set up the script so that if i type encrypt(script name) the letter that i want to start the encryption and then the file name, that it starts with the entered letter, and... (1 Reply)
Discussion started by: frankthetank115
1 Replies

4. Solaris

encrypt file

dear all i have xml file on solaris contains password for the databse how can i encrypt the password but the apache can read the password after encrypt it or if any one have any idea to make no one can read the password except apache (1 Reply)
Discussion started by: murad.jaber
1 Replies

5. Shell Programming and Scripting

encrypt my sctipt

Hai , is there any encrypt machanishm to protect my script or logic? (4 Replies)
Discussion started by: readycpbala
4 Replies

6. Shell Programming and Scripting

need encrypt form

Hi, i need to encrypt and decrypt of a string. pls provide me some syntax or any method available using shell script. i know one method i.e., perl -e 'print pack "H*","message"' so if perl command doesnt work then what is the other method to encrypt and decrypt. Thanks in advance. (0 Replies)
Discussion started by: syamkp
0 Replies

7. Shell Programming and Scripting

Need help with file encrypt

Hi I need to encrypt the below file using the translate command to shift each letter five characters to the end of the character set. ALPHABETICAL FACTS. THE FIRST THREE LETTERS ARE ABC. THE MEDIAN LETTERS ARE MN. THE LAST THREE LETTERS ARE XYZ. THE FIRST WORD IN MY DISCTIONARY IS AAL. THE... (1 Reply)
Discussion started by: drew211
1 Replies

8. Shell Programming and Scripting

Encrypt and Decrypt

I have script for all oracle prod db. I have hard coded the username / password. I need a mechanism to encode and decode the username / password in a shell script. Another challenge is I use the username and password in a Select command for oracle DB. How can call the decrypted... (2 Replies)
Discussion started by: ilugopal
2 Replies

9. Shell Programming and Scripting

How to identify heredocs in shell scripts?

tr a-z A-Z << END_TEXT one two three four five six END_TEXT i dont want this to be executed when someone runs the script that this is in. but for some reason, it gets executed. anywhere i can wrap this up in something to make sure it never gets executed? another example: cat <<... (1 Reply)
Discussion started by: SkySmart
1 Replies

10. Shell Programming and Scripting

Encrypt script

Hi, I have to encrypt my ash scripts on a distribution of linux with Armv5tejl Buildroot , I tried a lot of solutions but none works . Someone can help me? Thanks, Nicola (7 Replies)
Discussion started by: n.rito
7 Replies
Crypt::DES_EDE3(3pm)					User Contributed Perl Documentation				      Crypt::DES_EDE3(3pm)

NAME
Crypt::DES_EDE3 - Triple-DES EDE encryption/decryption SYNOPSIS
use Crypt::DES_EDE3; my $ede3 = Crypt::DES_EDE3->new($key); $ede3->encrypt($block); DESCRIPTION
Crypt::DES_EDE3 implements DES-EDE3 encryption. This is triple-DES encryption where an encrypt operation is encrypt-decrypt-encrypt, and decrypt is decrypt-encrypt-decrypt. This implementation uses Crypt::DES to do its dirty DES work, and simply provides a wrapper around that module: setting up the individual DES ciphers, initializing the keys, and performing the encryption/decryption steps. DES-EDE3 encryption requires a key size of 24 bytes. You're probably best off not using this module directly, as the encrypt and decrypt methods expect 8-octet blocks. You might want to use the module in conjunction with Crypt::CBC, for example. This would be DES-EDE3-CBC, or triple-DES in outer CBC mode. USAGE
$ede3 = Crypt::DES_EDE3->new($key) Creates a new Crypt::DES_EDE3 object (really, a collection of three DES ciphers), and initializes each cipher with part of $key, which should be at least 24 bytes. If it's longer than 24 bytes, the extra bytes will be ignored. Returns the new object. $ede3->encrypt($block) Encrypts an 8-byte block of data $block using the three DES ciphers in an encrypt-decrypt-encrypt operation. Returns the encrypted block. $ede3->decrypt($block) Decrypts an 8-byte block of data $block using the three DES ciphers in a decrypt-encrypt-decrypt operation. Returns the decrypted block. $ede3->blocksize Returns the block size(8). $ede3->keysize Returns the key size(24). LICENSE
Crypt::DES_EDE3 is free software; you may redistribute it and/or modify it under the same terms as Perl itself. AUTHOR &; COPYRIGHTS Crypt::DES_EDE3 is Copyright 2001 Benjamin Trott, ben@rhumba.pair.com. All rights reserved. perl v5.8.8 2001-09-15 Crypt::DES_EDE3(3pm)
All times are GMT -4. The time now is 06:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy