base
This commit is contained in:
@@ -0,0 +1,351 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# doc/Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
|
||||
srcdir = .
|
||||
top_srcdir = ..
|
||||
|
||||
pkgdatadir = $(datadir)/libmcrypt
|
||||
pkglibdir = $(libdir)/libmcrypt
|
||||
pkgincludedir = $(includedir)/libmcrypt
|
||||
top_builddir = ..
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = /usr/bin/install -c
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = x86_64-unknown-linux-gnu
|
||||
host_triplet = x86_64-unknown-linux-gnu
|
||||
target_triplet = x86_64-unknown-linux-gnu
|
||||
ACLOCAL = ${SHELL} /root/work/sdkfreebsd64.bak/libs/libmcrypt-2.5.7/missing --run aclocal-1.7
|
||||
AMDEP_FALSE = #
|
||||
AMDEP_TRUE =
|
||||
AMTAR = ${SHELL} /root/work/sdkfreebsd64.bak/libs/libmcrypt-2.5.7/missing --run tar
|
||||
AUTOCONF = ${SHELL} /root/work/sdkfreebsd64.bak/libs/libmcrypt-2.5.7/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /root/work/sdkfreebsd64.bak/libs/libmcrypt-2.5.7/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /root/work/sdkfreebsd64.bak/libs/libmcrypt-2.5.7/missing --run automake-1.7
|
||||
AWK = gawk
|
||||
CC = gcc
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -g -O2
|
||||
CPP = gcc -E
|
||||
CPPFLAGS =
|
||||
CYGPATH_W = echo
|
||||
DEFS = -DHAVE_CONFIG_H
|
||||
DEPDIR = .deps
|
||||
ECHO = echo
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = grep -E
|
||||
EXEEXT =
|
||||
EXTRA_ALGOS = cbc cfb ctr ecb ncfb nofb ofb stream threeway cast-128 gost rijndael-128 safer-sk64 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 safer-sk128 tripledes
|
||||
EXTRA_OBJECTS = ../modules/modes/cbc.lo ../modules/modes/cfb.lo ../modules/modes/ctr.lo ../modules/modes/ecb.lo ../modules/modes/ncfb.lo ../modules/modes/nofb.lo ../modules/modes/ofb.lo ../modules/modes/stream.lo ../modules/algorithms/cast-128.lo ../modules/algorithms/gost.lo ../modules/algorithms/rijndael-128.lo ../modules/algorithms/twofish.lo ../modules/algorithms/arcfour.lo ../modules/algorithms/cast-256.lo ../modules/algorithms/loki97.lo ../modules/algorithms/rijndael-192.lo ../modules/algorithms/saferplus.lo ../modules/algorithms/wake.lo ../modules/algorithms/blowfish-compat.lo ../modules/algorithms/des.lo ../modules/algorithms/rijndael-256.lo ../modules/algorithms/serpent.lo ../modules/algorithms/xtea.lo ../modules/algorithms/blowfish.lo ../modules/algorithms/enigma.lo ../modules/algorithms/rc2.lo ../modules/algorithms/tripledes.lo
|
||||
INCLTDL =
|
||||
INSTALL_ALGORITHM_MODULES =
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_MODE_MODULES =
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
|
||||
LDFLAGS =
|
||||
LIBLTDL =
|
||||
LIBLTDL_DIR =
|
||||
LIBMCRYPT_CFLAGS = -I${prefix}/include
|
||||
LIBMCRYPT_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER = 7
|
||||
LIBMCRYPT_LIBS = -L${exec_prefix}/lib -lmcrypt
|
||||
LIBMCRYPT_MAJOR_VERSION = 2
|
||||
LIBMCRYPT_MICRO_VERSION = 7
|
||||
LIBMCRYPT_MINOR_VERSION = 5
|
||||
LIBMCRYPT_MOST_RECENT_INTERFACE = 8
|
||||
LIBMCRYPT_OLDEST_INTERFACE = 4
|
||||
LIBMCRYPT_VERSION = 2.5.7
|
||||
LIBOBJS =
|
||||
LIBS =
|
||||
LIBTOOL = $(SHELL) $(top_builddir)/libtool
|
||||
LIBTOOL_DEPS = ./ltmain.sh
|
||||
LN_S = ln -s
|
||||
LTLIBOBJS =
|
||||
LT_AGE = 4
|
||||
LT_CURRENT = 8
|
||||
LT_REVISION = 7
|
||||
MAKEINFO = ${SHELL} /root/work/sdkfreebsd64.bak/libs/libmcrypt-2.5.7/missing --run makeinfo
|
||||
NOINSTALL_ALGORITHM_MODULES = threeway.la cast-128.la gost.la rijndael-128.la safer-sk64.la twofish.la arcfour.la cast-256.la loki97.la rijndael-192.la saferplus.la wake.la blowfish-compat.la des.la rijndael-256.la serpent.la xtea.la blowfish.la enigma.la rc2.la safer-sk128.la tripledes.la
|
||||
NOINSTALL_MODE_MODULES = cbc.la cfb.la ctr.la ecb.la ncfb.la nofb.la ofb.la stream.la
|
||||
OBJEXT = o
|
||||
PACKAGE = libmcrypt
|
||||
PACKAGE_BUGREPORT =
|
||||
PACKAGE_NAME =
|
||||
PACKAGE_STRING =
|
||||
PACKAGE_TARNAME =
|
||||
PACKAGE_VERSION =
|
||||
PATH_SEPARATOR = :
|
||||
RANLIB = ranlib
|
||||
SET_MAKE =
|
||||
SHELL = /bin/sh
|
||||
STRIP = strip
|
||||
VERSION = 2.5.7
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_RANLIB = ranlib
|
||||
ac_ct_STRIP = strip
|
||||
am__fastdepCC_FALSE = #
|
||||
am__fastdepCC_TRUE =
|
||||
am__include = include
|
||||
am__quote =
|
||||
bindir = ${exec_prefix}/bin
|
||||
build = x86_64-unknown-linux-gnu
|
||||
build_alias =
|
||||
build_cpu = x86_64
|
||||
build_os = linux-gnu
|
||||
build_vendor = unknown
|
||||
datadir = ${prefix}/share
|
||||
exec_prefix = ${prefix}
|
||||
host = x86_64-unknown-linux-gnu
|
||||
host_alias =
|
||||
host_cpu = x86_64
|
||||
host_os = linux-gnu
|
||||
host_vendor = unknown
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${prefix}/info
|
||||
install_sh = /root/work/sdkfreebsd64.bak/libs/libmcrypt-2.5.7/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${prefix}/man
|
||||
oldincludedir = /usr/include
|
||||
prefix = /usr/local
|
||||
program_transform_name = s,x,x,
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
subdirs =
|
||||
sysconfdir = ${prefix}/etc
|
||||
target = x86_64-unknown-linux-gnu
|
||||
target_alias =
|
||||
target_cpu = x86_64
|
||||
target_os = linux-gnu
|
||||
target_vendor = unknown
|
||||
EXTRA_DIST = README.key example.c mcrypt.3 README.xtea README.config
|
||||
man_MANS = mcrypt.3
|
||||
subdir = doc
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
|
||||
NROFF = nroff
|
||||
MANS = $(man_MANS)
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign doc/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
man3dir = $(mandir)/man3
|
||||
install-man3: $(man3_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(man3dir)
|
||||
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.3*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
3*) ;; \
|
||||
*) ext='3' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst; \
|
||||
done
|
||||
uninstall-man3:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.3*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
3*) ;; \
|
||||
*) ext='3' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f $(DESTDIR)$(man3dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man3dir)/$$inst; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(MANS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(man3dir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
distclean-am: clean-am distclean-generic distclean-libtool
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man: install-man3
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-man
|
||||
|
||||
uninstall-man: uninstall-man3
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-man3 install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||
uninstall-info-am uninstall-man uninstall-man3
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,2 @@
|
||||
EXTRA_DIST = README.key example.c mcrypt.3 README.xtea README.config
|
||||
man_MANS = mcrypt.3
|
||||
@@ -0,0 +1,351 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTRA_ALGOS = @EXTRA_ALGOS@
|
||||
EXTRA_OBJECTS = @EXTRA_OBJECTS@
|
||||
INCLTDL = @INCLTDL@
|
||||
INSTALL_ALGORITHM_MODULES = @INSTALL_ALGORITHM_MODULES@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_MODE_MODULES = @INSTALL_MODE_MODULES@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBLTDL = @LIBLTDL@
|
||||
LIBLTDL_DIR = @LIBLTDL_DIR@
|
||||
LIBMCRYPT_CFLAGS = @LIBMCRYPT_CFLAGS@
|
||||
LIBMCRYPT_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER = @LIBMCRYPT_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER@
|
||||
LIBMCRYPT_LIBS = @LIBMCRYPT_LIBS@
|
||||
LIBMCRYPT_MAJOR_VERSION = @LIBMCRYPT_MAJOR_VERSION@
|
||||
LIBMCRYPT_MICRO_VERSION = @LIBMCRYPT_MICRO_VERSION@
|
||||
LIBMCRYPT_MINOR_VERSION = @LIBMCRYPT_MINOR_VERSION@
|
||||
LIBMCRYPT_MOST_RECENT_INTERFACE = @LIBMCRYPT_MOST_RECENT_INTERFACE@
|
||||
LIBMCRYPT_OLDEST_INTERFACE = @LIBMCRYPT_OLDEST_INTERFACE@
|
||||
LIBMCRYPT_VERSION = @LIBMCRYPT_VERSION@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
LT_REVISION = @LT_REVISION@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
NOINSTALL_ALGORITHM_MODULES = @NOINSTALL_ALGORITHM_MODULES@
|
||||
NOINSTALL_MODE_MODULES = @NOINSTALL_MODE_MODULES@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
subdirs = @subdirs@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
EXTRA_DIST = README.key example.c mcrypt.3 README.xtea README.config
|
||||
man_MANS = mcrypt.3
|
||||
subdir = doc
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
|
||||
NROFF = nroff
|
||||
MANS = $(man_MANS)
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign doc/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
man3dir = $(mandir)/man3
|
||||
install-man3: $(man3_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(man3dir)
|
||||
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.3*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
3*) ;; \
|
||||
*) ext='3' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst; \
|
||||
done
|
||||
uninstall-man3:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.3*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
3*) ;; \
|
||||
*) ext='3' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f $(DESTDIR)$(man3dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man3dir)/$$inst; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(MANS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(man3dir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
distclean-am: clean-am distclean-generic distclean-libtool
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man: install-man3
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-man
|
||||
|
||||
uninstall-man: uninstall-man3
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-man3 install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||
uninstall-info-am uninstall-man uninstall-man3
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,14 @@
|
||||
If you want to find the libmcrypt library in other projects
|
||||
using autoconf/aclocal, put in your
|
||||
|
||||
aclocal.m4:
|
||||
include(libmcrypt.m4)
|
||||
|
||||
configure.in:
|
||||
AM_PATH_LIBMCRYPT( 2.4.11,, AC_MSG_ERROR([[*** libmcrypt was not found]]))
|
||||
|
||||
|
||||
these macros define LIBMCRYPT_LIBS and LIBMCRYPT_CFLAGS.
|
||||
If Libmcrypt version 2.2.x is found then LIBMCRYPT22 is defined,
|
||||
otherwise LIBMCRYPT24.
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Mcrypt 2.1 was insecure (vulnerable to brute force attack for weak keys)
|
||||
because it just used the plainkey as it was given by the user as algorithm's
|
||||
key. The solution seems to be a function which tranforms the
|
||||
key given by the user to a real -random looking- key.
|
||||
|
||||
There are many functions that may convert a password or a passphrase to
|
||||
a key. Most of them use hash algorithms. You can find some implementations
|
||||
at the libmhash package at: http://mhash.sourceforge.net
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
The xTEA algorithm may not be right implemented. There are two different
|
||||
behaved implementations, because the specification is not clear. I assumed
|
||||
that the C code in the specification is right, so in mcrypt xtea behaves
|
||||
exactly as the code shown in the specification. The different approach
|
||||
is the code in ftp.funet.fi which seems to be more rational than the
|
||||
code in the specification. But since there is no indication of the author of
|
||||
that code I decided not to adopt this version, and I assumed that the
|
||||
C specification is right.
|
||||
|
||||
Nikos
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
/* First example: Encrypts stdin to stdout using TWOFISH with 128 bit key and CFB */
|
||||
|
||||
#include <mcrypt.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
/* #include <mhash.h> */
|
||||
|
||||
main() {
|
||||
|
||||
MCRYPT td;
|
||||
int i;
|
||||
char *key;
|
||||
char password[20];
|
||||
char block_buffer;
|
||||
char *IV;
|
||||
int keysize=19; /* 128 bits */
|
||||
|
||||
key=calloc(1, keysize);
|
||||
strcpy(password, "A_large_key");
|
||||
|
||||
/* Generate the key using the password */
|
||||
/* mhash_keygen( KEYGEN_MCRYPT, MHASH_MD5, key, keysize, NULL, 0, password, strlen(password));
|
||||
*/
|
||||
memmove( key, password, strlen(password));
|
||||
|
||||
td = mcrypt_module_open("twofish", NULL, "cfb", NULL);
|
||||
if (td==MCRYPT_FAILED) {
|
||||
return 1;
|
||||
}
|
||||
IV = malloc(mcrypt_enc_get_iv_size(td));
|
||||
|
||||
/* Put random data in IV. Note these are not real random data,
|
||||
* consider using /dev/random or /dev/urandom.
|
||||
*/
|
||||
|
||||
/* srand(time(0)); */
|
||||
for (i=0; i< mcrypt_enc_get_iv_size( td); i++) {
|
||||
IV[i]=rand();
|
||||
}
|
||||
|
||||
i=mcrypt_generic_init( td, key, keysize, IV);
|
||||
if (i<0) {
|
||||
mcrypt_perror(i);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Encryption in CFB is performed in bytes */
|
||||
while ( fread (&block_buffer, 1, 1, stdin) == 1 ) {
|
||||
mcrypt_generic (td, &block_buffer, 1);
|
||||
|
||||
/* Comment above and uncomment this to decrypt */
|
||||
/* mdecrypt_generic (td, &block_buffer, 1); */
|
||||
|
||||
fwrite ( &block_buffer, 1, 1, stdout);
|
||||
}
|
||||
mcrypt_generic_deinit(td);
|
||||
|
||||
mcrypt_module_close(td);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Second Example: encrypts using CBC and SAFER+ with 192 bits key */
|
||||
|
||||
#include <mcrypt.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
main() {
|
||||
|
||||
MCRYPT td;
|
||||
int i;
|
||||
char *key; /* created using mcrypt_gen_key */
|
||||
char *block_buffer;
|
||||
char *IV;
|
||||
int blocksize;
|
||||
int keysize = 24; /* 192 bits == 24 bytes */
|
||||
|
||||
|
||||
key = calloc(1, keysize);
|
||||
strcpy(key, "A_large_and_random_key");
|
||||
|
||||
td = mcrypt_module_open("saferplus", NULL, "cbc", NULL);
|
||||
|
||||
blocksize = mcrypt_enc_get_block_size(td);
|
||||
block_buffer = malloc(blocksize);
|
||||
/* but unfortunately this does not fill all the key so the rest bytes are
|
||||
* padded with zeros. Try to use large keys or convert them with mcrypt_gen_key().
|
||||
*/
|
||||
|
||||
IV=malloc(mcrypt_enc_get_iv_size(td));
|
||||
|
||||
/* Put random data in IV. Note these are not real random data,
|
||||
* consider using /dev/random or /dev/urandom.
|
||||
*/
|
||||
|
||||
/* srand(time(0)); */
|
||||
for (i=0; i < mcrypt_enc_get_iv_size(td); i++) {
|
||||
IV[i]=rand();
|
||||
}
|
||||
|
||||
mcrypt_generic_init ( td key, keysize, IV);
|
||||
|
||||
/* Encryption in CBC is performed in blocks */
|
||||
while ( fread (block_buffer, 1, blocksize, stdin) == blocksize ) {
|
||||
mcrypt_generic (td, block_buffer, blocksize);
|
||||
/* mdecrypt_generic (td, block_buffer, blocksize); */
|
||||
fwrite ( block_buffer, 1, blocksize, stdout);
|
||||
}
|
||||
mcrypt_generic_end (td);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,650 @@
|
||||
.TH MCRYPT 3 "10 March 2002"
|
||||
.SH NAME
|
||||
libmcrypt \- encryption/decryption library
|
||||
.SH SYNOPSIS
|
||||
[see also
|
||||
.I mcrypt.h
|
||||
for more information]
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.I libmcrypt
|
||||
is a data encryption library.
|
||||
The library is thread safe and provides encryption and decryption functions.
|
||||
This version of the library supports many encryption algorithms and encryption
|
||||
modes. Some algorithms which are supported:
|
||||
SERPENT, RIJNDAEL, 3DES, GOST, SAFER+, CAST-256, RC2, XTEA, 3WAY,
|
||||
TWOFISH, BLOWFISH, ARCFOUR, WAKE and more.
|
||||
.LP
|
||||
OFB, CBC, ECB, nOFB, nCFB and CFB are the modes that all algorithms may function.
|
||||
ECB, CBC, encrypt in blocks but CTR, nCFB, nOFB, CFB and OFB in bytes (streams).
|
||||
Note that CFB and OFB in the rest of the document represent the "8bit CFB or OFB" mode.
|
||||
nOFB and nCFB modes represents a n-bit OFB/CFB mode, n is used to represent the
|
||||
algorithm's block size.
|
||||
The library supports an extra STREAM mode to include some stream algorithms
|
||||
like WAKE or ARCFOUR.
|
||||
|
||||
In this version of the library all modes and algorithms are modular,
|
||||
which means that the algorithm and the mode is loaded at run-time.
|
||||
This way you can add algorithms and modes faster, and much easier.
|
||||
|
||||
.I LibMcrypt
|
||||
includes the following symmetric (block) algorithms:
|
||||
|
||||
.B DES:
|
||||
The traditional DES algorithm designed by IBM and US NSA.
|
||||
Uses 56 bit key and 64 bit block. It is now considered a weak
|
||||
algorithm, due to its small key size (it was never intended for use
|
||||
with classified data).
|
||||
|
||||
.B 3DES or Triple DES:
|
||||
DES but with multiple (triple) encryption. It encrypts the plaintext
|
||||
once, then decrypts it with the second key, and encrypts it again with
|
||||
the third key (outer cbc mode used for cbc).
|
||||
Much better than traditional DES since the key is now 168 bits (actually
|
||||
the effective key length is 112 bits due to the meet-in-the-middle attack).
|
||||
|
||||
.B CAST-128:
|
||||
CAST was designed in Canada by Carlisle Adams and Stafford Tavares.
|
||||
The original algorithm used a 64bit key and block. The algorithm
|
||||
here is CAST-128 (also called CAST5) which has a 128bit key and 64bit block size.
|
||||
|
||||
.B CAST-256:
|
||||
CAST-256 was designed by Carlisle Adams. It is a symmetric cipher designed in
|
||||
accordance with the CAST design procedure. It is an extention of
|
||||
the CAST-128, having a 128 bit block size, and up to 256 bit key size.
|
||||
|
||||
.B xTEA:
|
||||
TEA stands for the Tiny Encryption Algorithm. It is a feistel cipher
|
||||
designed by David Wheeler & Roger M. Needham.
|
||||
The original TEA was intended for use in applications where
|
||||
code size is at a premium, or where it is necessary for someone to remember
|
||||
the algorithm and code it on an arbitrary machine at a later time.
|
||||
The algorithm used here is extended TEA and has a 128bit key size and
|
||||
64bit block size.
|
||||
|
||||
.B 3-WAY:
|
||||
The 3way algorithm designed by Joan Daemen. It uses key and block size
|
||||
of 96 bits.
|
||||
|
||||
.B SKIPJACK:
|
||||
SKIPJACK was designed by the US NSA. It was part of the ill-fated
|
||||
"Clipper" Escrowed Encryption Standard (EES) (FIPS 185) proposal. It
|
||||
operates on 64bit blocks and uses a key of 80 bits. SKIPJACK is provided only as an extra module to libmcrypt.
|
||||
|
||||
.B BLOWFISH:
|
||||
The Blowfish algorithm designed by Bruce Schneier. It is better and faster
|
||||
than DES. It can use a key up to 448 bits.
|
||||
|
||||
.B TWOFISH:
|
||||
Twofish was designed by Bruce Schneier, Doug Whiting, John Kelsey, Chris
|
||||
Hall, David Wagner for Counterpane systems. Intended to be highly secure
|
||||
and highly flexible. It uses a 128bit block size and 128,192,256 bit key size.
|
||||
(Twofish is the default algorithm)
|
||||
|
||||
.B LOKI97:
|
||||
LOKI97 was designed by Lawrie Brown and Josef Pieprzyk. It has a 128-bit
|
||||
block length and a 256bit key schedule, which can be initialized
|
||||
using 128, 192 or 256 bit keys. It has evolved from the
|
||||
earlier LOKI89 and LOKI91 64-bit block ciphers, with a strengthened key
|
||||
schedule and a larger keyspace.
|
||||
|
||||
.B RC2:
|
||||
RC2 (RC stands for Rivest Cipher) was designed by Ron Rivest. It uses block size of 64 bit and a key size
|
||||
from 8 to 1024 bits. It is optimized for 16bit microprocessors (reflecting
|
||||
its age). It is described in the RFC2268.
|
||||
|
||||
.B ARCFOUR:
|
||||
RC4 was designed by Ron Rivest. For several years this algorithm was
|
||||
considered a trade secret and details were not available. In September 1994 someone
|
||||
posted the source code in the cypherpunks mailing list. Although the source
|
||||
code is now available RC4 is trademarked by RSADSI so a compatible cipher named
|
||||
ARCFOUR is included in the mcrypt distribution. It is a stream cipher
|
||||
and has a maximum key of 2048 bits.
|
||||
|
||||
.B RC6:
|
||||
RC6 was designed by Ron Rivest for RSA labs. In mcrypt it uses block size of 128 bit and
|
||||
a key size of 128/192/256 bits.
|
||||
Refer to RSA Labs and Ron Rivest for any copyright, patent or license issues
|
||||
for the RC6 algorithm. RC6 is provided only as an extra module to libmcrypt.
|
||||
|
||||
.B RIJNDAEL:
|
||||
Rijndael is a block cipher, designed by Joan Daemen and Vincent Rijmen,
|
||||
and was approved for the USA's NIST Advanced Encryption Standard, FIPS-197.
|
||||
The cipher has a variable block length and key length. Rijndael can be implemented very efficiently on a wide range
|
||||
of processors and in hardware. The design of Rijndael was strongly influenced
|
||||
by the design of the block cipher Square.
|
||||
There exist three versions of this algorithm, namely:
|
||||
.B RIJNDAEL-128 (the AES winner)
|
||||
,
|
||||
.B RIJNDAEL-192
|
||||
,
|
||||
.B RIJNDAEL-256
|
||||
The numerals 128, 192 and 256 stand for the length of the block size.
|
||||
|
||||
.B MARS:
|
||||
MARS is a 128-bit block cipher designed by IBM as a candidate for the
|
||||
Advanced Encryption Standard. Refer to IBM for any copyright, patent or license issues
|
||||
for the MARS algorithm. MARS is provided only as an extra module to libmcrypt.
|
||||
|
||||
.B PANAMA:
|
||||
PANAMA is a cryptographic module that can be used both as a
|
||||
cryptographic hash function and as a stream cipher. It designed by Joan
|
||||
Daemen and Craig Clapp. PANAMA (the stream cipher) is included in
|
||||
libmcrypt.
|
||||
|
||||
.B WAKE:
|
||||
WAKE stands for Word Auto Key Encryption, and is an encryption system for
|
||||
medium speed encryption of blocks and of high security.
|
||||
WAKE was designed by David J. Wheeler. It is intended to
|
||||
be fast on most computers and relies on repeated table use and having a
|
||||
large state space.
|
||||
|
||||
.B SERPENT:
|
||||
Serpent is a 128-bit block cipher designed by Ross Anderson, Eli Biham and
|
||||
Lars Knudsen as a candidate for the Advanced Encryption Standard.
|
||||
Serpent's design was limited to well understood mechanisms, so that
|
||||
could rely on the wide experience of block cipher cryptanalysis, and
|
||||
achieve the highest practical level of assurance that no shortcut attack will
|
||||
be found. Serpent has twice as many rounds as are necessary, to block all
|
||||
currently known shortcut attacks. Despite these exacting design constraints,
|
||||
Serpent is faster than DES.
|
||||
|
||||
.B IDEA:
|
||||
IDEA stands for International Data Encryption Algorithm and was designed
|
||||
by Xuejia Lai and James Massey. It operates on 64bit blocks and uses a key of 128 bits.
|
||||
Refer to Ascom-Tech AG for any copyright, patent or license issues
|
||||
for the IDEA algorithm. IDEA is provided only as an extra module to libmcrypt.
|
||||
|
||||
.B ENIGMA (UNIX crypt):
|
||||
A one-rotor machine designed along the lines of Enigma but considerable
|
||||
trivialized. Very easy to break for a skilled cryptanalyst.
|
||||
I suggest against using it. Added just for completeness.
|
||||
|
||||
.B GOST:
|
||||
A former soviet union's algorithm. An acronym for "Gosudarstvennyi Standard"
|
||||
or Government Standard. It uses a 256 bit key and a 64 bit block.
|
||||
The S-boxes used here are described in the Applied Cryptography book
|
||||
by Bruce Schneier. They were used in an application for the Central Bank
|
||||
of the Russian Federation.
|
||||
Some quotes from gost.c:
|
||||
The standard is written by A. Zabotin (project leader), G.P. Glazkov,
|
||||
and V.B. Isaeva. It was accepted and introduced into use by the
|
||||
action of the State Standards Committee of the USSR on 2 June 1989 as
|
||||
No. 1409. It was to be reviewed in 1993, but whether anyone wishes
|
||||
to take on this obligation from the USSR is questionable.
|
||||
This code is based on the 25 November 1993 draft translation
|
||||
by Aleksandr Malchik, with Whitfield Diffie, of the Government
|
||||
Standard of the U.S.S.R. GOST 28149-89, "Cryptographic Transformation
|
||||
Algorithm", effective 1 July 1990. (Whitfield.Diffie@eng.sun.com)
|
||||
Some details have been cleared up by the paper "Soviet Encryption
|
||||
Algorithm" by Josef Pieprzyk and Leonid Tombak of the University
|
||||
of Wollongong, New South Wales. (josef/leo@cs.adfa.oz.au)
|
||||
|
||||
.B SAFER:
|
||||
SAFER (Secure And Fast Encryption Routine) is a block cipher developed
|
||||
by Prof. J.L. Massey at the Swiss Federal Institute of Technology.
|
||||
There exist four versions of this algorithm, namely:
|
||||
.B SAFER K-64
|
||||
,
|
||||
.B SAFER K-128
|
||||
,
|
||||
.B SAFER SK-64
|
||||
and
|
||||
.B SAFER SK-128.
|
||||
The numerals 64 and 128 stand for the length of the user-selected
|
||||
key, 'K' stands for the original key schedule and 'SK' stands for the
|
||||
strengthened key schedule (in which some of the "weaknesses" of the
|
||||
original key schedule have been removed). In mcrypt only SAFER SK-64 and
|
||||
SAFER SK-128 are used.
|
||||
|
||||
.B SAFER+:
|
||||
SAFER+ was designed by Prof. J.L. Massey, Prof. Gurgen H. Khachatrian and
|
||||
Dr. Melsik K. Kuregian for Cylink. SAFER+ is based on the existing SAFER
|
||||
family of ciphers and provides for a block size of 128bits and 128, 192
|
||||
and 256 bits key length.
|
||||
|
||||
|
||||
.LP
|
||||
A short description of the modes supported by libmcrypt:
|
||||
|
||||
.B STREAM:
|
||||
The mode used with stream ciphers. In this mode the keystream from
|
||||
the cipher is XORed with the plaintext. Thus you should NOT ever use the
|
||||
same key.
|
||||
|
||||
.B ECB:
|
||||
The Electronic CodeBook mode. It is the simplest mode to use with a
|
||||
block cipher. Encrypts each block independently. It is a block mode
|
||||
so plaintext length should be a multiple of blocksize (n*blocksize).
|
||||
|
||||
.B CBC:
|
||||
The Cipher Block Chaining mode. It is better than ECB since the plaintext
|
||||
is XOR'ed with the previous ciphertext. A random block should be placed as the
|
||||
first block (IV) so the same block or messages always encrypt to something
|
||||
different. It is a block mode so plaintext length should be a multiple
|
||||
of blocksize (n*blocksize).
|
||||
|
||||
.B CFB:
|
||||
The Cipher-Feedback Mode (in 8bit). This is a self-synchronizing
|
||||
stream cipher implemented from a block cipher. This is the best mode
|
||||
to use for encrypting strings or streams. This mode requires an IV.
|
||||
|
||||
.B OFB:
|
||||
The Output-Feedback Mode (in 8bit). This is a synchronous
|
||||
stream cipher implemented from a block cipher. It is intended for use
|
||||
in noisy lines, because corrupted ciphertext blocks do not corrupt the
|
||||
plaintext blocks that follow. Insecure (because used in 8bit mode) so it is
|
||||
recommended not to use it. Added just for completeness.
|
||||
|
||||
.B nOFB:
|
||||
The Output-Feedback Mode (in nbit). n Is the size of the block of the
|
||||
algorithm. This is a synchronous stream cipher implemented from a block
|
||||
cipher. It is intended for use in noisy lines, because corrupted ciphertext
|
||||
blocks do not corrupt the plaintext blocks that follow. This mode
|
||||
operates in streams.
|
||||
|
||||
.B nCFB:
|
||||
The Cipher-Feedback Mode (in nbit). n Is the size of the block of the
|
||||
algorithm. This is a self synchronizing stream cipher implemented from a block
|
||||
cipher. This mode operates in streams.
|
||||
|
||||
.B CTR:
|
||||
The Counter Mode. This is a stream cipher implemented from a block
|
||||
cipher. This mode uses the cipher to encrypt a set of input blocks, called
|
||||
counters, to produce blocks that will be XORed with the plaintext.
|
||||
In libmcrypt the counter is the given IV which is incremented at each step.
|
||||
This mode operates in streams.
|
||||
|
||||
.B Error Recovery in these modes:
|
||||
If bytes are removed or lost from the file or stream in ECB, CTR, CBC and OFB modes,
|
||||
are impossible to recover, although CFB and nCFB modes will recover. If some
|
||||
bytes are altered then a full block of plaintext is affected in ECB, nOFB and CTR modes,
|
||||
two blocks in CBC, nCFB and CFB modes, but only the corresponding byte in OFB mode.
|
||||
|
||||
.LP
|
||||
Encryption can be done as follows:
|
||||
|
||||
A call to function:
|
||||
.B MCRYPT mcrypt_module_open( char *algorithm, char* algorithm_directory,
|
||||
.B char* mode, char* mode_directory);
|
||||
|
||||
This function associates the algorithm and the mode specified.
|
||||
The name of the algorithm is specified in algorithm, eg "twofish", and the algorithm_directory
|
||||
is the directory where the algorithm is (it may be null if it is
|
||||
the default). The same applies for the mode.
|
||||
The library is closed by calling mcrypt_module_close(), but you should
|
||||
not call that function if mcrypt_generic_end() is called before.
|
||||
Normally it returns an encryption descriptor,
|
||||
or MCRYPT_FAILED on error.
|
||||
|
||||
A call to function:
|
||||
.B int mcrypt_generic_init( MCRYPT td, void *key,
|
||||
.B int lenofkey,
|
||||
.B void *IV);
|
||||
|
||||
This function initializes all buffers for the specified thread
|
||||
The maximum value of lenofkey should be the one obtained by
|
||||
calling mcrypt_get_key_size() and every value smaller than this is legal.
|
||||
Note that Lenofkey should be specified in bytes not bits.
|
||||
The IV should normally have the size of the algorithms block size, but
|
||||
you must obtain the size by calling mcrypt_get_iv_size().
|
||||
IV is ignored in ECB. IV MUST exist in CFB, CBC, STREAM, nOFB and
|
||||
OFB modes. It needs to be random and unique (but not secret). The same IV must be used
|
||||
for encryption/decryption.
|
||||
After calling this function you can use the descriptor for encryption
|
||||
or decryption (not both).
|
||||
Returns a negative value on error.
|
||||
|
||||
To encrypt now call:
|
||||
|
||||
.B int mcrypt_generic( MCRYPT td, void *plaintext, int len);
|
||||
|
||||
This is the main encryption function. td is the encryption descriptor
|
||||
returned by mcrypt_generic_init(). Plaintext is the plaintext you
|
||||
wish to encrypt and len should be the length (in bytes) of the
|
||||
plaintext and it should be k*algorithms_block_size if used in a mode
|
||||
which operated in blocks (cbc, ecb, nofb), or whatever when used in
|
||||
cfb or ofb which operate in streams. The plaintext is replaced by the
|
||||
ciphertext. Returns 0 on success.
|
||||
|
||||
To decrypt you can call:
|
||||
|
||||
.B int mdecrypt_generic( MCRYPT td, void *ciphertext, int len);
|
||||
|
||||
The decryption function. It is almost the same with mcrypt_generic.
|
||||
Returns 0 on success.
|
||||
|
||||
When you're finished you should call:
|
||||
|
||||
.B int mcrypt_generic_end( MCRYPT td);
|
||||
|
||||
This function terminates encryption specified by the encryption descriptor (td).
|
||||
Actually it clears all buffers, and closes all the modules used.
|
||||
Returns a negative value on error.
|
||||
.B This function is deprecated.
|
||||
Use mcrypt_generic_deinit() and mcrypt_module_close() instead.
|
||||
|
||||
.B int mcrypt_generic_deinit( MCRYPT td);
|
||||
|
||||
This function terminates encryption specified by the encryption descriptor (td).
|
||||
Actually it clears all buffers. The difference with mcrypt_generic_end() is that
|
||||
this function does not close the modules used. Thus you should use mcrypt_module_close().
|
||||
Using this function you gain in speed if you use the same modules for several
|
||||
encryptions.
|
||||
Returns a negative value on error.
|
||||
|
||||
.B int mcrypt_module_close( MCRYPT td);
|
||||
|
||||
This function closes the modules used by the descriptor td.
|
||||
|
||||
.P
|
||||
These are some extra functions that operate on modules that have been opened:
|
||||
These functions have the prefix mcrypt_enc_*.
|
||||
|
||||
.B int mcrypt_enc_set_state(MCRYPT td, void *state, int size);
|
||||
This function sets the state of the algorithm. Can
|
||||
be used only with block algorithms and certain modes like CBC, CFB etc.
|
||||
It is usefully if you want to restart or start a different encryption quickly.
|
||||
Returns zero on success. The state is the output of mcrypt_enc_get_state().
|
||||
|
||||
.B int mcrypt_enc_get_state(MCRYPT td, void *state, int *size);
|
||||
This function returns the state of the algorithm. Can
|
||||
be used only certain modes and algorithms. The size will hold the
|
||||
size of the state and the state must have enough bytes to hold it.
|
||||
Returns zero on success.
|
||||
|
||||
.B int mcrypt_enc_self_test( MCRYPT td);
|
||||
|
||||
This function runs the self test on the algorithm specified by the descriptor
|
||||
td. If the self test succeeds it returns zero.
|
||||
|
||||
.B int mcrypt_enc_is_block_algorithm_mode( MCRYPT td);
|
||||
|
||||
Returns 1 if the mode is for use with block algorithms, otherwise
|
||||
it returns 0. (eg. 0 for stream, and 1 for cbc, cfb, ofb)
|
||||
|
||||
.B int mcrypt_enc_is_block_algorithm( MCRYPT td);
|
||||
|
||||
Returns 1 if the algorithm is a block algorithm or 0 if it is a stream
|
||||
algorithm.
|
||||
|
||||
.B int mcrypt_enc_is_block_mode( MCRYPT td);
|
||||
|
||||
Returns 1 if the mode outputs blocks of bytes or 0 if it outputs bytes.
|
||||
(eg. 1 for cbc and ecb, and 0 for cfb and stream)
|
||||
|
||||
.B int mcrypt_enc_get_block_size( MCRYPT td);
|
||||
|
||||
Returns the block size of the algorithm specified by the encryption descriptor
|
||||
in bytes. The algorithm MUST be opened using mcrypt_module_open().
|
||||
|
||||
.B int mcrypt_enc_get_key_size( MCRYPT td);
|
||||
|
||||
Returns the maximum supported key size of the algorithm specified by the encryption descriptor
|
||||
in bytes. The algorithm MUST be opened using mcrypt_module_open().
|
||||
|
||||
.B int* mcrypt_enc_get_supported_key_sizes( MCRYPT td, int* sizes)
|
||||
|
||||
Returns the key sizes supported by the algorithm specified by the encryption descriptor.
|
||||
If sizes is zero and returns NULL then all key sizes between 1 and mcrypt_get_key_size() are
|
||||
supported by the algorithm. If it is 1 then only the mcrypt_get_key_size()
|
||||
size is supported and sizes[0] is equal to it. If it is greater than 1 then
|
||||
that number specifies the number of elements in sizes which are the key
|
||||
sizes that the algorithm supports. The returned value is allocated with
|
||||
malloc, so you should not forget to free it.
|
||||
|
||||
.B int mcrypt_enc_get_iv_size( MCRYPT td);
|
||||
|
||||
Returns size of the IV of the algorithm specified by the encryption descriptor
|
||||
in bytes. The algorithm MUST be opened using mcrypt_module_open().
|
||||
If it is '0' then the IV is ignored in that algorithm. IV is used in CBC,
|
||||
CFB, OFB modes, and in some algorithms in STREAM mode.
|
||||
|
||||
.B int mcrypt_enc_mode_has_iv( MCRYPT td);
|
||||
|
||||
Returns 1 if the mode needs an IV, 0 otherwise. Some 'stream' algorithms
|
||||
may need an IV even if the mode itself does not need an IV.
|
||||
|
||||
.B char* mcrypt_enc_get_algorithms_name( MCRYPT td);
|
||||
|
||||
Returns a character array containing the name of the algorithm.
|
||||
The returned value is allocated with malloc, so you should not forget to
|
||||
free it.
|
||||
|
||||
.B char* mcrypt_enc_get_modes_name( MCRYPT td);
|
||||
|
||||
Returns a character array containing the name of the mode.
|
||||
The returned value is allocated with malloc, so you should not forget to
|
||||
free it.
|
||||
|
||||
.P
|
||||
These are some extra functions that operate on modules:
|
||||
These functions have the prefix mcrypt_module_*.
|
||||
|
||||
.B int mcrypt_module_self_test (char* algorithm, char* directory);
|
||||
|
||||
This function runs the self test on the specified algorithm. If the self
|
||||
test succeeds it returns zero.
|
||||
|
||||
.B int mcrypt_module_is_block_algorithm_mode( char* algorithm, char* directory);
|
||||
|
||||
Returns 1 if the mode is for use with block algorithms, otherwise
|
||||
it returns 0. (eg. 0 for stream, and 1 for cbc, cfb, ofb)
|
||||
|
||||
.B int mcrypt_module_is_block_algorithm( char* mode, char* directory);
|
||||
|
||||
Returns 1 if the algorithm is a block algorithm or 0 if it is a stream
|
||||
algorithm.
|
||||
|
||||
.B int mcrypt_module_is_block_mode( char* mode, char* directory);
|
||||
|
||||
Returns 1 if the mode outputs blocks of bytes or 0 if it outputs bytes.
|
||||
(eg. 1 for cbc and ecb, and 0 for cfb and stream)
|
||||
|
||||
.B int mcrypt_module_get_algo_block_size( char* algorithm, char* directory);
|
||||
|
||||
Returns the block size of the algorithm.
|
||||
|
||||
.B int mcrypt_module_get_algo_key_size( char* algorithm, char* directory);
|
||||
|
||||
Returns the maximum supported key size of the algorithm.
|
||||
|
||||
.B int* mcrypt_module_get_algo_supported_key_sizes( char* algorithm, char* directory, int* sizes);
|
||||
|
||||
Returns the key sizes supported by the algorithm. If sizes is zero and
|
||||
returns NULL then all key sizes between 1 and mcrypt_get_key_size() are
|
||||
supported by the algorithm. If it is 1 then only the mcrypt_get_key_size()
|
||||
size is supported and sizes[0] is equal to it. If it is greater than 1 then
|
||||
that number specifies the number of elements in sizes which are the key
|
||||
sizes that the algorithm supports. This function differs to
|
||||
mcrypt_enc_get_supported_key_sizes(), because the return value here is
|
||||
allocated (not static), thus it should be freed.
|
||||
|
||||
.LP
|
||||
|
||||
.B char** mcrypt_list_algorithms ( char* libdir, int* size);
|
||||
|
||||
Returns a pointer to a character array containing all
|
||||
the mcrypt algorithms located in the libdir, or if it is NULL, in
|
||||
the default directory. The size is the number of the character arrays.
|
||||
The arrays are allocated internally and should be freed by using mcrypt_free_p().
|
||||
|
||||
.B char** mcrypt_list_modes ( char* libdir, int *size);
|
||||
|
||||
Returns a pointer to a character array containing all
|
||||
the mcrypt modes located in the libdir, or if it is NULL, in
|
||||
the default directory. The size is the number of the character arrays.
|
||||
The arrays should be freed by using mcrypt_free_p().
|
||||
|
||||
.B void mcrypt_free_p (char **p, int size);
|
||||
|
||||
Frees the pointer to array returned by previous functions.
|
||||
|
||||
.B void mcrypt_free (void *ptr);
|
||||
|
||||
Frees the memory used by the pointer.
|
||||
|
||||
.B void mcrypt_perror(int err);
|
||||
|
||||
This function prints a human readable description of the error 'err' in the stderr.
|
||||
The err should be a value returned by mcrypt_generic_init().
|
||||
|
||||
.B const char* mcrypt_strerror(int err);
|
||||
|
||||
This function returns a human readable description of the error 'err'.
|
||||
The err should be a value returned by mcrypt_generic_init().
|
||||
|
||||
.B int mcrypt_mutex_register ( void (*mutex_lock)(void) , void (*mutex_unlock)(void) );
|
||||
|
||||
This function is only used in multithreaded application and only if compiled
|
||||
with dynamic module loading support. This is actually used
|
||||
internally in libltdl. Except for the dynamic module loading libmcrypt is
|
||||
thread safe.
|
||||
|
||||
.LP
|
||||
Some example programs follow here. Compile as "cc prog.c -lmcrypt", or
|
||||
"cc prog.c -lmcrypt -lltdl" depending on your installation.
|
||||
Libltdl is used for opening dynamic libraries (modules).
|
||||
|
||||
.nf
|
||||
/* First example: Encrypts stdin to stdout using TWOFISH with 128 bit key and CFB */
|
||||
|
||||
#include <mcrypt.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
/* #include <mhash.h> */
|
||||
|
||||
main() {
|
||||
|
||||
MCRYPT td;
|
||||
int i;
|
||||
char *key;
|
||||
char password[20];
|
||||
char block_buffer;
|
||||
char *IV;
|
||||
int keysize=16; /* 128 bits */
|
||||
|
||||
key=calloc(1, keysize);
|
||||
strcpy(password, "A_large_key");
|
||||
|
||||
/* Generate the key using the password */
|
||||
/* mhash_keygen( KEYGEN_MCRYPT, MHASH_MD5, key, keysize, NULL, 0, password, strlen(password));
|
||||
*/
|
||||
memmove( key, password, strlen(password));
|
||||
|
||||
td = mcrypt_module_open("twofish", NULL, "cfb", NULL);
|
||||
if (td==MCRYPT_FAILED) {
|
||||
return 1;
|
||||
}
|
||||
IV = malloc(mcrypt_enc_get_iv_size(td));
|
||||
|
||||
/* Put random data in IV. Note these are not real random data,
|
||||
* consider using /dev/random or /dev/urandom.
|
||||
*/
|
||||
|
||||
/* srand(time(0)); */
|
||||
for (i=0; i< mcrypt_enc_get_iv_size( td); i++) {
|
||||
IV[i]=rand();
|
||||
}
|
||||
|
||||
i=mcrypt_generic_init( td, key, keysize, IV);
|
||||
if (i<0) {
|
||||
mcrypt_perror(i);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Encryption in CFB is performed in bytes */
|
||||
while ( fread (&block_buffer, 1, 1, stdin) == 1 ) {
|
||||
mcrypt_generic (td, &block_buffer, 1);
|
||||
|
||||
/* Comment above and uncomment this to decrypt */
|
||||
/* mdecrypt_generic (td, &block_buffer, 1); */
|
||||
|
||||
fwrite ( &block_buffer, 1, 1, stdout);
|
||||
}
|
||||
|
||||
/* Deinit the encryption thread, and unload the module */
|
||||
mcrypt_generic_end(td);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Second Example: encrypts using CBC and SAFER+ with 192 bits key */
|
||||
|
||||
#include <mcrypt.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
main() {
|
||||
|
||||
MCRYPT td;
|
||||
int i;
|
||||
char *key; /* created using mcrypt_gen_key */
|
||||
char *block_buffer;
|
||||
char *IV;
|
||||
int blocksize;
|
||||
int keysize = 24; /* 192 bits == 24 bytes */
|
||||
|
||||
|
||||
key = calloc(1, keysize);
|
||||
strcpy(key, "A_large_and_random_key");
|
||||
|
||||
td = mcrypt_module_open("saferplus", NULL, "cbc", NULL);
|
||||
|
||||
blocksize = mcrypt_enc_get_block_size(td);
|
||||
block_buffer = malloc(blocksize);
|
||||
/* but unfortunately this does not fill all the key so the rest bytes are
|
||||
* padded with zeros. Try to use large keys or convert them with mcrypt_gen_key().
|
||||
*/
|
||||
|
||||
IV=malloc(mcrypt_enc_get_iv_size(td));
|
||||
|
||||
/* Put random data in IV. Note these are not real random data,
|
||||
* consider using /dev/random or /dev/urandom.
|
||||
*/
|
||||
|
||||
/* srand(time(0)); */
|
||||
for (i=0; i < mcrypt_enc_get_iv_size(td); i++) {
|
||||
IV[i]=rand();
|
||||
}
|
||||
|
||||
mcrypt_generic_init( td, key, keysize, IV);
|
||||
|
||||
/* Encryption in CBC is performed in blocks */
|
||||
while ( fread (block_buffer, 1, blocksize, stdin) == blocksize ) {
|
||||
mcrypt_generic (td, block_buffer, blocksize);
|
||||
/* mdecrypt_generic (td, block_buffer, blocksize); */
|
||||
fwrite ( block_buffer, 1, blocksize, stdout);
|
||||
}
|
||||
|
||||
/* deinitialize the encryption thread */
|
||||
mcrypt_generic_deinit (td);
|
||||
|
||||
/* Unload the loaded module */
|
||||
mcrypt_module_close(td);
|
||||
return 0;
|
||||
|
||||
}
|
||||
.fi
|
||||
|
||||
.LP
|
||||
The library does not install any signal handler.
|
||||
.LP
|
||||
Questions about libmcrypt should be sent to:
|
||||
.IP
|
||||
mcrypt-dev@lists.hellug.gr
|
||||
or, if this fails, to the author addresses given below.
|
||||
The mcrypt home page is:
|
||||
.IP
|
||||
http://mcrypt.hellug.gr
|
||||
.LP
|
||||
.SH AUTHORS
|
||||
Version 2.4
|
||||
Copyright (C) 1998-1999 Nikos Mavroyanopoulos (nmav@hellug.gr).
|
||||
.LP
|
||||
Thanks to all the people who reported problems and suggested various
|
||||
improvements for mcrypt; who are too numerous to cite here.
|
||||
.LP
|
||||
.\" end of man page
|
||||
Reference in New Issue
Block a user