Sponsored Content
Top Forums Shell Programming and Scripting String handling is not working inside if loop Post 302316035 by ghostdog74 on Wednesday 13th of May 2009 11:28:22 PM
Old 05-14-2009
change the "=" to "==" . by the way, your code has a lot of processing overheads.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

looping a array inside inside ssh is not working, pls help

set -A arr a1 a2 a3 a4 # START ssh -xq $Server1 -l $Username /usr/bin/ksh <<-EOS integer j=0 for loop in ${arr} do printf "array - ${arr}\n" (( j = j + 1 )) j=`expr j+1` done EOS # END ========= this is not giving me correct output. I... (5 Replies)
Discussion started by: reldb
5 Replies

2. Shell Programming and Scripting

Using variables created sequentially in a loop while still inside of the loop [bash]

I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends. As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

3. Shell Programming and Scripting

Null Handling in Until loop. . .loop won't stop

Hi Im running this script, which is supposed to find the max value build some tables and then stop running once all the tables are built. Thing is , it keeps assigning a null value to $h and then $g is null so it keep building tables i.e. testupdateNUL. How can I stop this? Here is what I have: ... (4 Replies)
Discussion started by: brandono66
4 Replies

4. Shell Programming and Scripting

String concatenation not working in a loop

Hi, First post, so I hope someone can help me with this weirdness :) I have a number files with some rows of information I want to extract, at the same time I want to add to a string some details from the file. I have found two different ways of looping over rows in a file, but one method... (5 Replies)
Discussion started by: LostInTheWoods
5 Replies

5. Shell Programming and Scripting

BASH loop inside a loop question

Hi all Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Discussion started by: rethink
4 Replies

6. Shell Programming and Scripting

String comparison not working inside while loop

Hi, In the code included below, the string comparision is not working fine. Please help while (( find_out >= i )) do file=`head -$i f.out|tail -1` dir=`dirname $file` cd $dir Status="" if ; then Status=`cvs -Q status... (3 Replies)
Discussion started by: sudvishw
3 Replies

7. Shell Programming and Scripting

string comparison not working inside while loop

The string comparison highlighted below is not working fine. Please help: while read line do # Get File name by deleting everything that preceedes and follows Filename as printed in cvs status' output f_name=`echo $line | sed -e 's/^File://' -e 's/ *Status:.*//' | awk '{print $NF}'` ... (4 Replies)
Discussion started by: sudvishw
4 Replies

8. Shell Programming and Scripting

set -options not working inside for loop?

I'm a beginner in shell scripting (I'm using ksh). I'm manipulating some files and I'm using set -A to transform each read line into a numeric array. However, inside the 'for' loop the options of set (ie '-A') are not recognized (the vi editor doesn't highlight it and it doesn't work). Where... (4 Replies)
Discussion started by: kasumlolla
4 Replies

9. Shell Programming and Scripting

If loop inside function not working.

check_deplver () { dir=/abc/def/ghi if ssh -o StrictHostKeychecking=no $1 "" 2> /dev/null then echo " output is " ssh -o StrictHostKeychecking=no $1 "ls -lrt $dir | grep -i abc" 2> /dev/null else echo " directory not presnt" fi } This is not working. But... (7 Replies)
Discussion started by: NarayanaPrakash
7 Replies

10. Shell Programming and Scripting

Perl : How is file handling working here??

Hi, I have a perl script which is just reading from the file but what I would like to understand is how the counter is moving without using the loop in the script. Below are the details: $ more /tmp/abc.txt This is 0 This is 1 This is 2 This is 3 This is 4 This is 5 This is 6 This... (2 Replies)
Discussion started by: siddharthjindal
2 Replies
DES_MODES(7)							      OpenSSL							      DES_MODES(7)

NAME
des_modes - the variants of DES and other crypto algorithms of OpenSSL DESCRIPTION
Several crypto algorithms for OpenSSL can be used in a number of modes. Those are used for using block ciphers in a way similar to stream ciphers, among other things. OVERVIEW
Electronic Codebook Mode (ECB) Normally, this is found as the function algorithm_ecb_encrypt(). o 64 bits are enciphered at a time. o The order of the blocks can be rearranged without detection. o The same plaintext block always produces the same ciphertext block (for the same key) making it vulnerable to a 'dictionary attack'. o An error will only affect one ciphertext block. Cipher Block Chaining Mode (CBC) Normally, this is found as the function algorithm_cbc_encrypt(). Be aware that des_cbc_encrypt() is not really DES CBC (it does not update the IV); use des_ncbc_encrypt() instead. o a multiple of 64 bits are enciphered at a time. o The CBC mode produces the same ciphertext whenever the same plaintext is encrypted using the same key and starting variable. o The chaining operation makes the ciphertext blocks dependent on the current and all preceding plaintext blocks and therefore blocks can not be rearranged. o The use of different starting variables prevents the same plaintext enciphering to the same ciphertext. o An error will affect the current and the following ciphertext blocks. Cipher Feedback Mode (CFB) Normally, this is found as the function algorithm_cfb_encrypt(). o a number of bits (j) <= 64 are enciphered at a time. o The CFB mode produces the same ciphertext whenever the same plaintext is encrypted using the same key and starting variable. o The chaining operation makes the ciphertext variables dependent on the current and all preceding variables and therefore j-bit variables are chained together and can not be rearranged. o The use of different starting variables prevents the same plaintext enciphering to the same ciphertext. o The strength of the CFB mode depends on the size of k (maximal if j == k). In my implementation this is always the case. o Selection of a small value for j will require more cycles through the encipherment algorithm per unit of plaintext and thus cause greater processing overheads. o Only multiples of j bits can be enciphered. o An error will affect the current and the following ciphertext variables. Output Feedback Mode (OFB) Normally, this is found as the function algorithm_ofb_encrypt(). o a number of bits (j) <= 64 are enciphered at a time. o The OFB mode produces the same ciphertext whenever the same plaintext enciphered using the same key and starting variable. More over, in the OFB mode the same key stream is produced when the same key and start variable are used. Consequently, for security reasons a specific start variable should be used only once for a given key. o The absence of chaining makes the OFB more vulnerable to specific attacks. o The use of different start variables values prevents the same plaintext enciphering to the same ciphertext, by producing different key streams. o Selection of a small value for j will require more cycles through the encipherment algorithm per unit of plaintext and thus cause greater processing overheads. o Only multiples of j bits can be enciphered. o OFB mode of operation does not extend ciphertext errors in the resultant plaintext output. Every bit error in the ciphertext causes only one bit to be in error in the deciphered plaintext. o OFB mode is not self-synchronizing. If the two operation of encipherment and decipherment get out of synchronism, the system needs to be re-initialized. o Each re-initialization should use a value of the start variable different from the start variable values used before with the same key. The reason for this is that an identical bit stream would be produced each time from the same parameters. This would be susceptible to a 'known plaintext' attack. Triple ECB Mode Normally, this is found as the function algorithm_ecb3_encrypt(). o Encrypt with key1, decrypt with key2 and encrypt with key3 again. o As for ECB encryption but increases the key length to 168 bits. There are theoretic attacks that can be used that make the effective key length 112 bits, but this attack also requires 2^56 blocks of memory, not very likely, even for the NSA. o If both keys are the same it is equivalent to encrypting once with just one key. o If the first and last key are the same, the key length is 112 bits. There are attacks that could reduce the effective key strength to only slightly more than 56 bits, but these require a lot of memory. o If all 3 keys are the same, this is effectively the same as normal ecb mode. Triple CBC Mode Normally, this is found as the function algorithm_ede3_cbc_encrypt(). o Encrypt with key1, decrypt with key2 and then encrypt with key3. o As for CBC encryption but increases the key length to 168 bits with the same restrictions as for triple ecb mode. NOTES
This text was been written in large parts by Eric Young in his original documentation for SSLeay, the predecessor of OpenSSL. In turn, he attributed it to: AS 2805.5.2 Australian Standard Electronic funds transfer - Requirements for interfaces, Part 5.2: Modes of operation for an n-bit block cipher algorithm Appendix A SEE ALSO
blowfish(3), des(3), idea(3), rc2(3) 1.0.1e 2013-02-11 DES_MODES(7)
All times are GMT -4. The time now is 03:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy