Why does RSA encrypted text give me different results for the same text

A secure RSA encryption is implemented with an appropriate padding scheme, which includes some randomness. See PKCS#1 or OAEP for more details. The RSA encryption encrypts message padded with ‘0’s and a string of random bit. In the process, the random string is “hidden” in the ciphertext by cryptographic hashing and XORing. On decryption, the … Read more

Shell script “for” loop syntax

Brace expansion, {x..y} is performed before other expansions, so you cannot use that for variable length sequences. Instead, use the seq 2 $max method as user mob stated. So, for your example it would be: max=10 for i in `seq 2 $max` do echo “$i” done

Grepping for exact words with UNIX

Use whole word option: grep -c -w aaa $EAT_Setup_BJ3/Log.txt From the grep manual: -w, –word-regexp Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. As noted in the comment -w is … Read more

Crontab Formatting – every 15 minutes

Crontab doesn’t remember what time you “started” (presumably the time you executed the crontab -e or crontab filename command). If you want to run the job every 15 minutes starting from an arbitrary time, you’ll have to specify that time. This: 7-59/15 * * * * command will run at 7, 22, 37, and 52 … Read more