Sponsored Content
Top Forums Shell Programming and Scripting Encript Timestamp with blowfish Post 302463832 by zarahel on Monday 18th of October 2010 02:24:46 PM
Old 10-18-2010
Encript Timestamp with blowfish

Good afternoon to you all

I need help

I need a script that will allow to encrypt the system´s timestamp;

I have to use a pre-shared key to cipher the timestamp, so basically I need:

1st) cipher with a pre-shared key
2nd) encrypt the timestamp
3rd) encode on a base64

the output should be something like:

g_6iIMPST6ZXcc9Yk3jYtA==

I would really apreciate your help
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

samba questions (password conversion to blowfish and is it wise to sync the useraccou

i stumbled upon something that gave some nice instructions on how to convert FreeBSD passwords from md5 to blowfish. it was simple and straight forward and it worked. i'm running samba on the machine. now i know the tutorial i was following had something where a user's samba and machine... (1 Reply)
Discussion started by: xyyz
1 Replies

2. Shell Programming and Scripting

how to encript password in .netrc file

hi, I am using .netrc file WITH OUT encripting the password Code in .netrc file: ------------------- machine $SYSTEM NAME login FTFOA001 password 1Q2W3E4R how to encript password in .netrc file.(i should not use "1Q2W3E4R" as password). after encripting i should able to connect with... (1 Reply)
Discussion started by: getgopu25
1 Replies

3. Shell Programming and Scripting

how to encript a shell

I have a unix shell, there is a way to encript the whole shell, and be able to run the encripted shell, so I can give my client the encripted shell, and he can't see the code I wrote? (6 Replies)
Discussion started by: pedro_lezaeta
6 Replies

4. Shell Programming and Scripting

Getting a relative timestamp from timestamp stored in a file

Hi, I've a file in the following format 1999-APR-8 17:31:06 1500 3 45 1999-APR-8 17:31:15 1500 3 45 1999-APR-8 17:31:25 1500 3 45 1999-APR-8 17:31:30 1500 3 45 1999-APR-8 17:31:55 1500 3 45 1999-APR-8 17:32:06 1500 3 ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

5. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

6. Shell Programming and Scripting

Identifying files with a timestamp greater than a given timestamp

I need to be able to identify files with file timestamps greater than a given timestamp. I am using the following solution, although it appears to compare files at the "seconds" granularity and I need it at the milliseconds. When I tested my solution, it missed files that had timestamps... (3 Replies)
Discussion started by: nkm0brm
3 Replies

7. Homework & Coursework Questions

[SOLVED] blowfish algorithm: encrypting the p-array.

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am trying to encrypt the p-array. The first element will print correctly once returned from my encrypt... (2 Replies)
Discussion started by: robin_simple
2 Replies

8. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies

9. Shell Programming and Scripting

AIX : Need to convert UNIX Timestamp to normal timestamp

Hello , I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt Contents of... (6 Replies)
Discussion started by: rahul2662
6 Replies

10. Shell Programming and Scripting

Grep lines between last hour timestamp and current timestamp

So basically I have a log file and each line in this log file starts with a timestamp: MON DD HH:MM:SS SEP 15 07:30:01 I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies
blowfish(n)						       Blowfish Block Cipher						       blowfish(n)

__________________________________________________________________________________________________________________________________________________

NAME
blowfish - Implementation of the Blowfish block cipher SYNOPSIS
package require Tcl 8.4 package require blowfish ?1.0.4? ::blowfish::blowfish ?-mode [ecb|cbc]? ?-dir [encrypt|decrypt]? -key keydata ?-iv vector? ?-out channel? ?-chunksize size? ?-pad padchar? [ -in channel | ?--? data ] ::blowfish::Init mode keydata iv ::blowfish::Encrypt Key data ::blowfish::Decrypt Key data ::blowfish::Reset Key iv ::blowfish::Final Key _________________________________________________________________ DESCRIPTION
This package is an implementation in Tcl of the Blowfish algorithm developed by Bruce Schneier [1]. Blowfish is a 64-bit block cipher designed to operate quickly on 32 bit architectures and accepting a variable key length. This implementation supports ECB and CBC mode blowfish encryption. COMMANDS
::blowfish::blowfish ?-mode [ecb|cbc]? ?-dir [encrypt|decrypt]? -key keydata ?-iv vector? ?-out channel? ?-chunksize size? ?-pad padchar? [ -in channel | ?--? data ] Perform the blowfish algorithm on either the data provided by the argument or on the data read from the -in channel. If an -out channel is given then the result will be written to this channel. The -key option must be given. This parameter takes a binary string of variable length and is used to generate the blowfish key schedule. You should be aware that creating a key schedule is quite an expensive operation in blowfish so it is worth reusing the key where possible. See Reset. The -mode and -dir options are optional and default to cbc mode and encrypt respectively. The initialization vector -iv takes an 8 byte binary argument which defaults to 8 zeros. See MODES OF OPERATION for more about available modes and their uses. Blowfish is a 64-bit block cipher. This means that the data must be provided in units that are a multiple of 8 bytes. The blowfish command will by default add nul characters to pad the input data to a multiple of 8 bytes if necessary. The programming api commands will never add padding and instead will raise an error if the input is not a multiple of the block size. The -pad option can be used to change the padding character or to disable padding if the empty string is provided as the argument. PROGRAMMING INTERFACE
::blowfish::Init mode keydata iv Construct a new blowfish key schedule using the specified key data and the given initialization vector. The initialization vector is not used with ECB mode but is important for CBC mode. See MODES OF OPERATION for details about cipher modes. ::blowfish::Encrypt Key data Use a prepared key acquired by calling Init to encrypt the provided data. The data argument should be a binary array that is a mul- tiple of the block size of 8 bytes. The result is a binary array the same size as the input of encrypted data. ::blowfish::Decrypt Key data Decipher data using the key. Note that the same key may be used to encrypt and decrypt data provided that the initialization vector is reset appropriately for CBC mode. ::blowfish::Reset Key iv Reset the initialization vector. This permits the programmer to re-use a key and avoid the cost of re-generating the key schedule where the same key data is being used multiple times. ::blowfish::Final Key This should be called to clean up resources associated with Key. Once this function has been called the key may not be used again. MODES OF OPERATION
Electronic Code Book (ECB) ECB is the basic mode of all block ciphers. Each block is encrypted independently and so identical plain text will produce identical output when encrypted with the same key. Any encryption errors will only affect a single block however this is vulnerable to known plaintext attacks. Cipher Block Chaining (CBC) CBC mode uses the output of the last block encryption to affect the current block. An initialization vector of the same size as the cipher block size is used to handle the first block. The initialization vector should be chosen randomly and transmitted as the first block of the output. Errors in encryption affect the current block and the next block after which the cipher will correct itself. CBC is the most commonly used mode in software encryption. EXAMPLES
% blowfish::blowfish -hex -mode ecb -dir encrypt -key secret01 "hello, world!" d0d8f27e7a374b9e2dbd9938dd04195a set Key [blowfish::Init cbc $eight_bytes_key_data $eight_byte_iv] append ciphertext [blowfish::Encrypt $Key $plaintext] append ciphertext [blowfish::Encrypt $Key $additional_plaintext] blowfish::Final $Key REFERENCES
[1] Schneier, B. "Applied Cryptography, 2nd edition", 1996, ISBN 0-471-11709-9, pub. John Wiley & Sons. AUTHORS
Frank Pilhofer, Pat Thoyts BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category blowfish of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
3des, des, rc4 KEYWORDS
block cipher, blowfish, cryptography, encryption, security COPYRIGHT
Copyright (c) 2003, Pat Thoyts <patthoyts@users.sourceforge.net> blowfish 1.0.3 blowfish(n)
All times are GMT -4. The time now is 07:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy