Hi all, I'm just getting back in to C programming after some time and I thought I would start off with a simple XOR encryption program. However I'm having trouble getting it to work. The code in prompt() function works great when it is just placed in side of main() however I want to be able to pass my arrays and file pointers to the prompt function to make the code more modular. Any help is much appreciated!
When I execute following shell script I am getting the following error
syntax error at line 50 : `<<' unmatched
What am I doing wrong :confused:
Script begins here
----------------
MPAN_FILE=$1
exec 3<$MPAN_FILE ... (2 Replies)
Does anyone see anything wrong with this.
#getInfraFiles()
#{
# cd Infra/$DAY
# rm *
# /usr/bin/ftp -i -n $LINE << cmd
# user "$USER" "$PASSWD"
# cd $INFRAPATH
# binary
# mget *
# bye
#}
besides that its commented out (4 Replies)
Hello,
I have a simple script such as
-----------------------------
#! /bin/sh
YEAR=`date -u +%Y`;
MONTH=`date -u +%m`;
DAY=`date -u +%d`;
DATE=$MONTH$DAY$YEAR
LOGFILES=auditTrail-$DATE
LOGMATCH=$LOGFILES\*
ARGUM=''
# find all files and write them to a file
find . -name... (7 Replies)
I really just mess around in UNIX, for the most part, when I want to get something done. I can usually piece things together by searching for brief how-to's on Google, but the syntax errors in my following .sh file are really confusing me. I've got lots of programming experience in other places, so... (7 Replies)
when user select option 2 nothing happen.for testing purpose I put
echo command but is not executing .
basically when user prompt for option 2,I want to get list of database name from user separeted by space (TEST DEVL)
and put into the file seprated by new line
TEST
DEVL
after that stay on... (1 Reply)
I am working on a simple login ID check shell script that should prompt for a user ID then check to see if this user is logged on. Trying to get the hang of this stuff so I am thinking of my own little projects.
#! /bin/sh
echo "please enter a user name"
read user
if user=$user
then... (3 Replies)
Hi ! all I am just trying to check range in my datafile
pls tell me why its resulting wrong
admin@IEEE:~/Desktop$ cat test.txt
0 28.4
5 28.4
10 28.4
15 28.5
20 28.5
25 28.6
30 28.6
35 28.7
40 28.7
45 28.7
50 28.8
55 28.8
60 28.8
65 28.1... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies
LEARN ABOUT OSF1
crypt16
crypt(3) Library Functions Manual crypt(3)NAME
crypt, crypt16, setkey, encrypt - DES encryption
SYNOPSIS
#include <unistd.h>
#include <stdlib.h>
char *crypt(
const char *key,
const char *salt);
char *crypt16(
const char *key,
const char *salt);
void setkey(
const char *key);
DESCRIPTION
The subroutine is the password encryption routine. It is based on the NBS Data Encryption Standard, with variations intended to frustrate
use of hardware implementations of the DES for key search.
The first argument to is normally a user's typed password. The second is a 2-character string chosen from the set [a-zA-Z0-9./]. The salt
string is used to perturb the DES algorithm in one of 4096 different ways, after which the password is used as the key to encrypt repeat-
edly a constant string. The returned value points to the encrypted password, in the same alphabet as the salt. The first two characters
are the salt itself.
The subroutine is identical to the function except that it will accept a password up to sixteen characters in length. It generates a longer
encrypted password for use with enhanced security features.
The other entries provide primitive access to the actual DES algorithm. The argument of is a character array of length 64 containing only
the characters with numerical value 0 and 1. If this string is divided into groups of 8, the low-order bit in each group is ignored, lead-
ing to a 56-bit key which is set into the machine.
The argument to the entry is likewise a character array of length 64 containing 0s and 1s. The argument array is modified in place to a
similar array representing the bits of the argument after having been subjected to the DES algorithm using the key set by If edflag is 0,
the argument is encrypted; if non-zero, it is decrypted.
RESTRICTIONS
The return values from and point to static data areas whose content is overwritten by each call.
ENVIRONMENT
Default Environment
In the default environment on systems that do not have the optional encryption software installed the function expects exactly one argu-
ment, the data to be encrypted. The edflag argument is not supplied and there is no way to decrypt data. If the optional encryption soft-
ware is installed the function behaves as it does in the POSIX environment. The syntax for the default environment follows:
void encrypt(block)
char *block;
POSIX Environment
In the POSIX environment the encrypt function always expects two arguments. The function will set errno to ENOSYS and return if edflag is
non-zero and the optional encryption software is not present. The syntax for the POSIX environment follows:
void encrypt(block, edflag)
char *block;
int edflag;
In all cases the function will set errno to ENOSYS and return if the optional encryption software is not present.
RELATED INFORMATION login(1), passwd(1), yppasswd(1), getpass(3), passwd(4), prpasswd(4) delim off
crypt(3)