473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to use libcrypt ?

Dear readers,

I would like to learn to use libcrypt on Linux, but when I execute this
program, it prints nothing.

I compile like so:
gcc -Wall -lcrypt crypt.c -o crypt

It ought to crypt "mysecrettext" with the key "mykey" and decrypt again
and finally print the result to the screen. But it doesn't=(

Can anyone help me?

Lots of love,
Janni
#include <crypt.h>
#include <stdio.h>
#include <string.h>

int main() {
char key[64] = "mykey"; /* bit pattern for key */
char txt[64] = "mysecrettext"; /* bit pattern for messages */
setkey(key);
encrypt(txt, 0); /* encode */
encrypt(txt, 1); /* decode */

printf("%s", txt);

return(0);
}

Nov 14 '05 #1
2 4800
On Tue, 30 Dec 2003 01:52:41 +0100, Janni Jensen
<d_e_l_e_t_e_janni@t_h_i_s_elvis.com> wrote in comp.lang.c:
Dear readers,

I would like to learn to use libcrypt on Linux, but when I execute this
program, it prints nothing.


Non-standard libraries that are not defined by the C standard are
off-topic here. Linux programming questions should be asked in
news:comp.os.linux.development.apps.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 14 '05 #2
> Non-standard libraries that are not defined by the C standard are
off-topic here. Linux programming questions should be asked in
news:comp.os.linux.development.apps.


Thanks=)

Hugs,
Janni

Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike Orb | last post by:
Hi. I've successfully installed PHP in the past but am having problems compiling it all of a sudden. To try to fix the problem I downloaded a fresh copy of Apache 1.3.29 and PHP 4.3.5 and kept the...
4
by: Keith | last post by:
All: What is the difference between Perl (CGI) and PHP (Apache module)? I thought both used servers to direct the user to the appropiate Perl or PHP program in order to execute the program to...
1
by: bruce | last post by:
hi... in trying to get viewcvs up/running, i tried to do the following: # python Python 2.3.3 (#1, May 7 2004, 10:31:40) on linux2 Type "help", "copyright", "credits" or "license" for more...
3
by: one2001boy | last post by:
Hello, I can build php 5.04 with apache 1.33 statically with the apache configuration option: --activate-module=src/modules/php5 How can I build php 5.04 with apache 2.0.54 statically? It...
3
by: Andreas Muck | last post by:
Hi! We have an application running on Linux (SuSE 7.2, kernel 2.4.16) that opens lots of connections to a Postgres database and occasionaly dies with segfault. Trying to reproduce the crash, I...
1
by: psql-mail | last post by:
I have applied the recent tsearch2 patch and recompiled the tsearch2 module but I am still experiencing the same backend crashes as I previously described. Thanks for any help, Mat GDB...
1
by: Phil Campaigne | last post by:
Hi Tom, THanks for your response. Here are my results: -bash-2.05b$ ldd /usr/local/pgsql/bin/psql libpq.so.3 => /usr/local/pgsql/lib/libpq.so.3 (0x40013000) libz.so.1 => /usr/lib/libz.so.1...
5
by: Alexander Nofftz | last post by:
Hi! I am unsuccessfully trying to get DB2 working under Debian GNU/Linux Unstable for some weeks now. The setup wizard of db2setup allways freezes. I have waited for a whole hour, but nothing...
4
by: whitemoss | last post by:
Hi, I've made some changes to my coding..but unfortunately, there were errors when compiling it..dunno how to solve it..hope anyone can help me...the errors: client.c: In function senddata:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.