Sponsored Content
Top Forums UNIX for Dummies Questions & Answers UNIX fun stuff - echo and dc - obfuscate/garble a string sort of Post 302938405 by newbie_01 on Sunday 15th of March 2015 10:55:50 PM
Old 03-15-2015
UNIX fun stuff - echo and dc - obfuscate/garble a string sort of

Hi,

Humorous UNIX Commands shows a fun way of using echo and dc to sort of obfuscate a string.

Code:
% echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc
  GET A LIFE!

I am just wanting to know if there is a way to sort of use dc and echo to print out an obfuscated/garbled string instead kinda doing the reverse of echo | dc? Should it be dc 'GET A LIFE!' | echo, that does not seem to be the way to it Smilie

So I want to be able to get the echo'ed string instead. I am trying to see if I can use this as some way of sending out a 'secret' message or password to a script or to a user so that when I reset their password, I'll just get them to do echo '<string>' | dc instead of sending them the plaintext password.

Any advise much appreciated. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Echo display alignment/sort order

Hi, My script prints a few varibales as each it reads each line of a text file and then prints them on screen, however iam having problem in aligning and sorting them. what happens is this Last First Number Mark leo 87798798... (1 Reply)
Discussion started by: shackman66
1 Replies

2. What is on Your Mind?

FUN POLL: What is the best UNIX/Linux for. . .?

With so many different flavors of UNIX and Linux available in the world, choosing the best one for yourself, your family, or for your organization can be such an overwhelming and rather difficult decision to make! :eek: If you were a salesman and you had to decide the best UNIX/Linux distro for... (1 Reply)
Discussion started by: MrrrrrNiceGuy
1 Replies

3. What is on Your Mind?

Time to have FUN my Unix/Linux friends...(One liners)...MUST read.. !!

As a mind refresher, I was thinking to start a new thread for ONE LINERS....funny/weird or any technical one liners.... Let me start first...... ================================= #!/bin/ssh #The Unix Guru's View of Sex unzip ; strip ; touch ; grep ; finger ; mount ; fsck ; more ; yes ;... (3 Replies)
Discussion started by: Rahulpict
3 Replies

4. Shell Programming and Scripting

intro to UNIX - making a sort-of recycle bin (for fun)

Hello, I'm only taking Intro to UNIX in school right now, so please bear with me. My problem is with a sort-of recycle-bin rig I've created for fun. I'm using Ubuntu 9.04, I am the admin. (only user, actually) of this computer. I'm using this script in ~/.bashrc # if files exist, remove contents... (6 Replies)
Discussion started by: jzacsh
6 Replies

5. Programming

Obfuscate'ing a.out ... ???

Hi all, I've search the forums regarding posts similar to this already but can't find the suitable response. Am actually looking for something very trivial I think. I just want to mask/obfuscate the a.out file and run it like a normal UNIX program. I've look at gpg and encryption but it requires... (4 Replies)
Discussion started by: newbie_01
4 Replies

6. Shell Programming and Scripting

CSH: echo a string having []

I am trying to use echo in CSH and getting an error. I want to use to tell the user which parameters are optional. set msg2 = " -Inmod= -Nxz= -Varp=" echo $msg2 (3 Replies)
Discussion started by: kristinu
3 Replies

7. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

8. Programming

How to hide from UNIX strings - obfuscate or hide a literal or constant?

Hi, I need to somehow pipe the password to a command and run some SQL, for example, something like echo $password | sqlplus -s system @query01.sql To make it not so obvious, I decided to try out writing a small C program that basically just do echo $password. So now I just do x9.out | sqlplus... (8 Replies)
Discussion started by: newbie_01
8 Replies

9. UNIX for Dummies Questions & Answers

String size limit for 'echo'...

Hi guys, man bash doesn't help much here nor does the WWW. (I have discovered there is technically no limit to a bash array.) I am thinking of adding a new full manual inside AudioScope.sh. A few questions here. The main question is, assuming I go ahead with this idea:- Is there a limit... (6 Replies)
Discussion started by: wisecracker
6 Replies

10. Shell Programming and Scripting

UNIX: passing stuff to a shell function

I have users that print files to selected printers. Instead of creating one function for each printer I would like to have just one and passing the files to print as well as the wanted printer. The following code does not work, of course. I'm expecting that $1 is the list of files to be printed... (6 Replies)
Discussion started by: emare
6 Replies
LDAP_COMPARE(3) 							 1							   LDAP_COMPARE(3)

ldap_compare - Compare value of attribute found in entry specified with DN

SYNOPSIS
mixed ldap_compare (resource $link_identifier, string $dn, string $attribute, string $value) DESCRIPTION
Compare $value of $attribute with value of same attribute in an LDAP directory entry. PARAMETERS
o $link_identifier - An LDAP link identifier, returned by ldap_connect(3). o $dn - The distinguished name of an LDAP entity. o $attribute - The attribute name. o $value - The compared value. RETURN VALUES
Returns TRUE if $value matches otherwise returns FALSE. Returns -1 on error. EXAMPLES
The following example demonstrates how to check whether or not given password matches the one defined in DN specified entry. Example #1 Complete example of password check <?php $ds=ldap_connect("localhost"); // assuming the LDAP server is on this host if ($ds) { // bind if (ldap_bind($ds)) { // prepare data $dn = "cn=Matti Meikku, ou=My Unit, o=My Company, c=FI"; $value = "secretpassword"; $attr = "password"; // compare value $r=ldap_compare($ds, $dn, $attr, $value); if ($r === -1) { echo "Error: " . ldap_error($ds); } elseif ($r === true) { echo "Password correct."; } elseif ($r === false) { echo "Wrong guess! Password incorrect."; } } else { echo "Unable to bind to LDAP server."; } ldap_close($ds); } else { echo "Unable to connect to LDAP server."; } ?> NOTES
Warning ldap_compare(3) can NOT be used to compare BINARY values! PHP Documentation Group LDAP_COMPARE(3)
All times are GMT -4. The time now is 07:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy