Sponsored Content
Full Discussion: sha1 question
Top Forums Shell Programming and Scripting sha1 question Post 302501915 by radoulov on Saturday 5th of March 2011 05:05:29 PM
Old 03-05-2011
The latest Ubuntu uses bash4, so you could use something like this:

Code:
$ user=MyUser pass=mypass sessionid=mysessionid
$ _sha1=$(sha1sum <<< "$(sha1sum <<< "${user,,}$pass")$sessionid")
$ printf '%s\n' ${_sha1% *}
91aacc49855185f87659ffd87b8b4944c4822412

 

9 More Discussions You Might Find Interesting

1. Programming

Question !

Hi a am writing a C Programe on Vi Editor (File Handelling),and i am compiling it using fcc but it not compiling ,Even Vi not saving my file.Tell me how can i do that.One More Thing I want to know that ,Is their any subsitute of conio.h. (3 Replies)
Discussion started by: at_renai2001
3 Replies

2. Shell Programming and Scripting

Question

when the user selects an option ou from the list how is it possible to let the script detect the option and carry out the appropriate action...i noe its suppose to use the for or if loop..but how ?? (3 Replies)
Discussion started by: MaRk2002
3 Replies

3. UNIX for Dummies Questions & Answers

X Question

Hello, I've posted this in an X group, but I thought one of you might be able to help. I'm a novice programmer and I'm trying to write an X program in which pressing a button will launch another program. I know the syntax is something like "(Widget) -command {exec /usr/X11R6/bin/xcalc &}"... (5 Replies)
Discussion started by: af6
5 Replies

4. UNIX for Dummies Questions & Answers

got a question

on of the question that I have is that in class . We were asked this question **What command would you use to list the last modification time of all files in /tmp whose filenames end in exactly two digits? I know that we need to to ls /tmp/ ??.... but I did not know how to find that last... (2 Replies)
Discussion started by: xzyan
2 Replies

5. UNIX for Dummies Questions & Answers

Question

I need to write a script file that will tell me the largest number in a group of numbers. ANy help is greatly appreciated (2 Replies)
Discussion started by: twan
2 Replies

6. Shell Programming and Scripting

parse csv file, sha1 hash and output

I have a file, not really a csv, but containing delineated data just the same. Lets call that file "raw_data.txt". It contains data in the format of company name:fein number like this: first company name:123456789 second company name:987654321 what i need to do is read this file, apply... (11 Replies)
Discussion started by: FreddyG
11 Replies

7. UNIX Desktop Questions & Answers

Please Help me out with this question

. Make a new copy of mars.txt called marsx. What happens if you give the following commands when the files bio and marsx both already exist? Don't guess, try it! a) cp bio marsx b) mv bio marsx (2 Replies)
Discussion started by: rohit.katpalli
2 Replies

8. Programming

SHA1 hash calculation

hi i want to generate SHA1 hash of string in Linux (atmark) and downloaded the XYSSL-0.9 version code for the same.i have the algorithm which takes file as argument and returns hash of file . And of same file while I generated the key using online tools then it doesn't match with my compiled... (4 Replies)
Discussion started by: ahsaas42
4 Replies

9. OS X (Apple)

SHA1 verification script

Hi guys! Me again! ... I'm trying to build (on MacOS directly) a bash script that will help me verify a SHA1 digest (to verify downloads and so on and so forth). So first off, here's my version of BASH under OSX: bash-4.4$ And here's my version of Sierra (macOS): 10.12.3 (16D32) ... (2 Replies)
Discussion started by: Ardzii
2 Replies
SHA1SUM(1)                                                         User Commands                                                        SHA1SUM(1)

NAME
sha1sum - compute and check SHA1 message digest SYNOPSIS
sha1sum [OPTION]... [FILE]... DESCRIPTION
Print or check SHA1 (160-bit) checksums. With no FILE, or when FILE is -, read standard input. -b, --binary read in binary mode -c, --check read SHA1 sums from the FILEs and check them --tag create a BSD-style checksum -t, --text read in text mode (default) The following five options are useful only when verifying checksums: --ignore-missing don't fail or report status for missing files --quiet don't print OK for each successfully verified file --status don't output anything, status code shows success --strict exit non-zero for improperly formatted checksum lines -w, --warn warn about improperly formatted checksum lines --help display this help and exit --version output version information and exit The sums are computed as described in FIPS-180-1. When checking, the input should be a former output of this program. The default mode is to print a line with checksum, a space, a character indicating input mode ('*' for binary, ' ' for text or where binary is insignificant), and name for each FILE. BUGS
Do not use the SHA-1 algorithm for security related purposes. Instead, use an SHA-2 algorithm, implemented in the programs sha224sum(1), sha256sum(1), sha384sum(1), sha512sum(1), or the BLAKE2 algorithm, implemented in b2sum(1) AUTHOR
Written by Ulrich Drepper, Scott Miller, and David Madore. REPORTING BUGS
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report sha1sum translation bugs to <http://translationproject.org/team/> COPYRIGHT
Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
Full documentation at: <http://www.gnu.org/software/coreutils/sha1sum> or available locally via: info '(coreutils) sha1sum invocation' GNU coreutils 8.28 January 2018 SHA1SUM(1)
All times are GMT -4. The time now is 01:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy