Sponsored Content
Top Forums Programming Write own decryption application Post 302496550 by caciing_help on Monday 14th of February 2011 11:31:41 AM
Old 02-14-2011
have made some more amendments - still not working - perl install error at the moment (am working on that)

but am sure code is not correct either

anyone got any input they want to make?

Code:
#!/usr/local/bin/perl
use warnings;
use Crypt::Rijndael;
use Crypt::CBC;
#use Digest::SHA qw(sha512_hex);
use Digest::SHA;
 
 
#--------------------------------------------------------------------
# Parameters
#--------------------------------------------------------------------
my $my_key;
my $plain_text;
my $encrypted = "VACT_MEM_FIN_20110207.csv.enc";
my $cipher;
my $buffer;
my $decrypted = $encrypted;
#$decrypted =~ s/\.enc/\.txt/;
$decrypted="VACT_MEM_FIN_20110207.csv";
my $meth ="Crypt::OpenSSL::AES";

$my_key ='vactV@20110207';
$cipher = Crypt::CBC->new( {'literal_key'      => 1,
                            'key'             => $my_key,
                            #'cipher'          => 'Rijndael',
                            'keysize'         => 32,
                            'blocksize'       => 128,
                             'cipher' => $meth
                           });
#--------------------------------------------------------------------
# Decryption
#--------------------------------------------------------------------
open(FH_encrypted, "<$encrypted");
open(FH_decrypted, ">$decrypted");
$cipher->start('decrypting');
while (read(FH_encrypted,$buffer,1851)) {
   print FH_decrypted $cipher->crypt($buffer);
}
print FH_decrypted $cipher->finish;
close FH_encrypted;
close FH_decrypted;

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Decryption software

whats the most sufficient way to make decryption software? What are the recoomendations for one? (3 Replies)
Discussion started by: Phatress
3 Replies

2. UNIX for Advanced & Expert Users

which port to write my server application?

I want to write a server application that would accept HTTP requests from client. The server would be on a machine that has no connection to the INTERNET. The clients that would be posting their HTTP requests would be doing so through webbrowser .Thus it would be sort of intranet application.... (0 Replies)
Discussion started by: rraajjiibb
0 Replies

3. Programming

how to write application for 32 com port

Dear Sir, i m going to use NP5610-16 moxa device for multiport serial communication. i m using fedora-core 6 o.s. after installation it will detect serial ports as /dev/ttyr0,/dev/ttyr1...ttyr32. there are total 32 com ports. now i want to write application which monitor all serial ports and... (6 Replies)
Discussion started by: amitpansuria
6 Replies

4. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

5. Shell Programming and Scripting

Password decryption

Hi, I don't know if I am in a correct category with my question. I want to know what decryption-method is used for this password: (1) The first stadium is (its stored in the settings.xml of my software):... (2 Replies)
Discussion started by: Mogli1977
2 Replies

6. Shell Programming and Scripting

decryption issue!

Hi, Something bizarre is happening while decrypting the files. I had a decrypt script which was working smoothly on uname -a Linux ######### 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:33:05 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux After the front-end application was moved to uname -a Linux... (2 Replies)
Discussion started by: dips_ag
2 Replies

7. UNIX for Dummies Questions & Answers

decryption of .cpt file

Hi i have the path for encrytion file in unix and i want to decrypt the .cpt file in unix and change the password how can i do that . (3 Replies)
Discussion started by: lily
3 Replies

8. Shell Programming and Scripting

String encryption and decryption

Hello All, There are so many questions on this and I didn't find any concluded answer. I want to encrypt a string in the script, actually this is a password. I tried using openssl (I am a newbie to openssl), but it is generating a long one which we can't remember. I want to encrypt the... (5 Replies)
Discussion started by: karumudi7
5 Replies

9. Web Development

Apache2 web application- Submit button - write data into a file

Hello, I am newbie on php-mysql and just know only installation. I have an apache2+php5+mysql installed VPS. What I would like to do is that when visitor enters requested data shown in index.html, submit button will run a script to save each field into a file. Here is an example shown in... (1 Reply)
Discussion started by: baris35
1 Replies

10. UNIX for Advanced & Expert Users

How to write if condition in shell script for application server?

Hi all, I have a code to create folder in application server through shell script and i want to create if conditional based folder folder=$HOME/test/sample/whatever if ; then echo "$folder already exists, not created." else mkdir -p "$folder" > /dev/null 2>&1 ... (7 Replies)
Discussion started by: Boost
7 Replies
Crypt::DES_EDE3(3pm)					User Contributed Perl Documentation				      Crypt::DES_EDE3(3pm)

NAME
Crypt::DES_EDE3 - Triple-DES EDE encryption/decryption SYNOPSIS
use Crypt::DES_EDE3; my $ede3 = Crypt::DES_EDE3->new($key); $ede3->encrypt($block); DESCRIPTION
Crypt::DES_EDE3 implements DES-EDE3 encryption. This is triple-DES encryption where an encrypt operation is encrypt-decrypt-encrypt, and decrypt is decrypt-encrypt-decrypt. This implementation uses Crypt::DES to do its dirty DES work, and simply provides a wrapper around that module: setting up the individual DES ciphers, initializing the keys, and performing the encryption/decryption steps. DES-EDE3 encryption requires a key size of 24 bytes. You're probably best off not using this module directly, as the encrypt and decrypt methods expect 8-octet blocks. You might want to use the module in conjunction with Crypt::CBC, for example. This would be DES-EDE3-CBC, or triple-DES in outer CBC mode. USAGE
$ede3 = Crypt::DES_EDE3->new($key) Creates a new Crypt::DES_EDE3 object (really, a collection of three DES ciphers), and initializes each cipher with part of $key, which should be at least 24 bytes. If it's longer than 24 bytes, the extra bytes will be ignored. Returns the new object. $ede3->encrypt($block) Encrypts an 8-byte block of data $block using the three DES ciphers in an encrypt-decrypt-encrypt operation. Returns the encrypted block. $ede3->decrypt($block) Decrypts an 8-byte block of data $block using the three DES ciphers in a decrypt-encrypt-decrypt operation. Returns the decrypted block. $ede3->blocksize Returns the block size(8). $ede3->keysize Returns the key size(24). LICENSE
Crypt::DES_EDE3 is free software; you may redistribute it and/or modify it under the same terms as Perl itself. AUTHOR &; COPYRIGHTS Crypt::DES_EDE3 is Copyright 2001 Benjamin Trott, ben@rhumba.pair.com. All rights reserved. perl v5.8.8 2001-09-15 Crypt::DES_EDE3(3pm)
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy