Sponsored Content
Top Forums Shell Programming and Scripting Read user input, Encrypt the data and write to file Post 302727907 by saichand1985 on Wednesday 7th of November 2012 04:29:03 AM
Old 11-07-2012
thank you mirni, it worked perfectly. thanks for your help
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read/writte/input data in file.

Hi, how can i do to show when i do with scrip list entris, or list specific entry, it show 2 lines when i specify the entry to search...¿? i paste the script: # Global variables film=/opt/etc/film/film.txt export film confirm() { echo -en "$@" read ans ans=`echo $ans | tr... (0 Replies)
Discussion started by: dorek
0 Replies

2. Programming

Read/Write a fairly large amount of data to a file as fast as possible

Hi, I'm trying to figure out the best solution to the following problem, and I'm not yet that much experienced like you. :-) Basically I have to read a fairly large file, composed of "messages" , in order to display all of them through an user interface (made with QT). The messages that... (3 Replies)
Discussion started by: emitrax
3 Replies

3. Shell Programming and Scripting

Read Write byte range/chunk of data from specific location in file

I am new to Unix so will really appreciate if someone can guide me on this. What I want to do is: Step1: Read binary file - pick first 2 bytes, convert from hex to decimal. Read the next 3 bytes as well. 2 bytes will specify the number of bytes 'n' that I want to read and write... (1 Reply)
Discussion started by: Kbenipel
1 Replies

4. Shell Programming and Scripting

get data from input file and write another file

Hi, i have doubt in read and write using bash shell script... i will give the input file path and output file path in command line ex : example.sh iputfile outpilepath Here i need to read the input data then write that data to output file.. please give some example : (6 Replies)
Discussion started by: karthinvk
6 Replies

5. Shell Programming and Scripting

Read the apecific data from one file and write into another file

Hi, I would like to read the specific data from file and write the data in the new file. My data input is something like this.. <EXROP:R=TJ0311T; ROUTE DATA R ROUTE PARAMETERS TJ0311T DETY=UPDR TTRANS=1 FNC=3 MA=628160955000 R=TJ0311D ... (3 Replies)
Discussion started by: bha148
3 Replies

6. Shell Programming and Scripting

Help to write a script or program to automatic execute and link input file data

Output file template format <input_file_name>a</input_file_name> <total_length_size>b</total_length_size> <log_10_length_size>c</log_10_length_size> Input_file_1 (eg. sample.txt) SDFSDGDGSFGRTREREYWW Parameter: a is equal to the input file name b is equal to the total length of... (2 Replies)
Discussion started by: perl_beginner
2 Replies

7. Shell Programming and Scripting

Unfold the data from a input file and write to a file

I am working on a script to unfold data for each column from a specific line of data and write output in a single line. Input data looks like this. 2011-09-26 INF UM_10 UserMana Starting synchronization for security domain 14:37:31 080 gementSe . rvice I... (2 Replies)
Discussion started by: svajhala
2 Replies

8. Shell Programming and Scripting

Help with Bash piped while-read and a read user input at the same time

Hi I am new to writing script and want to use a Bash Piped while-read and read from user input. if something happens on server.log then do while loop or if something happend on user input then do while loop. Pseudocode something like: tail -n 3 -f server.log | while read serverline || read... (8 Replies)
Discussion started by: MyMorris
8 Replies

9. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

10. Shell Programming and Scripting

How to get the shell script to read the .txt file as an input/data?

i have written my shell script in notepad however i am struggling to pass the data file to be read to the script the data file is of .txt format. My target is to run the shell script from the terminal and pass 3 arguments e.g. polg@DESKTOP-BVPDC5C:~/CS1420/coursework$ bash valsplit.sh input.txt... (11 Replies)
Discussion started by: Gurdza32
11 Replies
encrypt(1)							   User Commands							encrypt(1)

NAME
encrypt, decrypt - encrypt or decrypt files SYNOPSIS
/usr/bin/encrypt -l | [-v] | -a algorithm [-k key_file] [-i input_file] [-o output_file] /usr/bin/decrypt -l | [-v] | -a algorithm [-k key_file] [-i input_file] [-o output_file] DESCRIPTION
This utility encrypts or decrypts the given file or stdin using the algorithm specified. If no output file is specified, output is to stan- dard out. If input and output are the same file, the encrypted output is written to a temporary work file in the same filesystem and then used to replace the original file. On decryption, if the input and output are the same file, the cleartext replaces the ciphertext file. The output file of encrypt and the input file for decrypt contains the following information: o Output format version number, 4 bytes in network byte order. The current version is 1. o Iterations used in key generation function, 4 bytes in network byte order. o IV (ivlen bytes)[1]. iv data is generated by random bytes equal to one block size. o Salt data used in key generation (16 bytes). o Cipher text data. OPTIONS
The following options are supported: -a algorithm Specify the name of the algorithm to use during the encryption or decryption process. See USAGE, Algorithms for details. -i input_file Specify the input file. Default is stdin if input_file is not specified. -k key_file Specify the file containing the key value for the encryption algorithm. Each algorithm has specific key material requirements, as stated in the PKCS#11 specification. If -k is not specified, encrypt prompts for key material using getpassphrase(3C). For information on generating a key file, see dd(1M) or System Administration Guide: Security Services. -l Display the list of algorithms available on the system. This list can change depending on the configuration of the cryptographic framework. The keysizes are displayed in bits. -o output_file Specify output file. Default is stdout if output_file is not specified. If stdout is used without redirecting to a file, the terminal window can appear to hang because the raw encrypted or decrypted data has disrupted the terminal emulation, much like viewing a binary file can do at times. -v Display verbose information. See Verbose. USAGE
Algorithms The supported algorithms are displayed with their minimum and maximum key sizes in the -l option. These algorithms are provided by the cryptographic framework. Each supported algorithm is an alias of the PKCS #11 mechanism that is the most commonly used and least restricted version of a particular algorithm type. For example: des is an alias to CKM_DES_CBC_PAD and arcfour is an alias to CKM_RC4. Algorithm vari- ants with no padding or ECB are not supported. See SECURITY for details. These aliases are used with the -a option and are case-sensitive. Passphrase When the -k option is not used during encryption and decryption tasks, the user is prompted for a passphrase. The passphrase is manipulated into a more secure key using the PBKDF2 algorithm specified in PKCS #5. When a passphrase is used with encrypt and decrypt, the user entered passphrase is turned into an encryption key using the PBKDF2 algorithm as defined defined in http://www.rsasecurity.com/rsalabs/pkcs/pkcs-5, PKCS #5 v2.0. Verbose If an input file is provided to the command, a progress bar spans the screen. The progress bar denotes every 25% completed with a pipe sign (|). If the input is from standard input, a period (.) is displayed each time 40KB is read. Upon completion of both input methods, Done is printed. EXAMPLES
Example 1: Listing Available Algorithms The following example lists available algorithms: example$ encrypt -l Algorithm Keysize: Min Max ----------------------------------- aes 128 128 arcfour 8 128 des 64 64 3des 192 192 Example 2: Encrypting Using AES The following example encrypts using AES and prompts for the encryption key: example$ encrypt -a aes -i myfile.txt -o secretstuff Example 3: Using an In Pipe to Provide Encrypted Tape Backup The following example uses an in pipe to provide encrypted tape backup: example$ ufsdump 0f - /var | encrypt -a arcfour -k /etc/mykeys/backup.k | dd of=/dev/rmt/0 Example 4: Using an In Pipe to Restore Tape Backup The following example uses and in pipe to restore a tape backup: example$ decrypt -a arcfour -k /etc/mykeys/backup.k -i /dev/rmt/0 | ufsrestore vf - Example 5: Encrypting an Input File Using the 3DES Algorithm The following example encrypts the inputfile file with the 192-bit key stored in the des3key file: example$ encrypt -a 3des -k des3key -i inputfile -o outputfile EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
digest(1), mac(1), dd(1M), getpassphrase(3C), libpkcs11(3LIB), attributes(5), pkcs11_softtoken(5) System Administration Guide: Security Services RSA PKCS#11 v2.11 http://www.rsasecurity.com/rsalabs/pkcs/pkcs-11 RSA PKCS#5 v2.0 http://www.rsasecurity.com/rsalabs/pkcs/pkcs-5 SunOS 5.10 25 May 2004 encrypt(1)
All times are GMT -4. The time now is 04:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy