User Profile
Collapse
-
Homework, absolutely no. Why do you think that could be a homework? I come from a C++ background and learning Ruby. The best way to learn any language is to play with it. I want to know how do I display the ASCII value of a char using the '?'. By the way how do you declare a character in Ruby?... -
But I need to use '?' to display the ASCII values of the characters....Leave a comment:
-
Displaying ASCII values
Hello All,
How do I display ASCII values from A..Z?
I tried the following but get some compiler error:
Code:def DisplayAscii() for index in 'A'..'Z' do puts ?index end end
-
What is happening in the following perl code?
Please explain what is happening in the following:
my ($salt) = $$input_stream =~ /^Salted__(.{8})/s;
What will $salt contain? -
Script using Crypt::CBC encryption/decryption
Hello friends,
I am new to Perl scripts.
Please help me out....
I am using crypt::CBC to encrypt my files...
during decryption process it goes through the code as follows
[CODE=perl]
if ($header_mode eq 'salt') {
my ($salt) = $$input_stream =~ /^Salted__(.{8})/s;
croak "Ciphertext does not begin with a valid header for 'salt' header mode" unless defined $salt;... -
Encrypt and decrypt
Anyone here know how to use crypto++ library or anyone has used crypto++ library to encrypt or decrypt a file?
Thanks -
C/C++ to Perl - unsiged char
How to write this in perl?
byte pass[] = { 0xA9, 0x9B, 0xC8, 0x32, 0x56, 0x35, 0xE3, 0x03,
0xA9, 0x9B, 0xC8, 0x32, 0x56, 0x35, 0xE3, 0x03 };
Thanks -
Code:______________________ |___mol1____|__mol2____| | | | |____________________ | |_1_|_2_|_3_|_.....|_72__| ____|________________ |_1_|_2_|_3_|_.....|_72__|
mol1 has allocated space for maxatoms 72, and mol2 has allocated space for...Leave a comment:
-
Dont you think using a vector in the above scenario is a big waste of memory though is helps me to "randomly access" the elements?
Thanks...Leave a comment:
-
vector or list ---> confused
Hi guys,
I know what a vector and a list is?
I have this scenario and I want to know which will be best to use.
I have a class called "molecule". The maximum number of atoms a molecule can hold is 72. The number of atoms vary depending on the type of molecule, it can be 4 or 10 or 1 or 50 etc etc...upto maxatoms.
Hence, since the maximum number of atoms is fixed i.e 72, and for current... -
-
-
-
perl script to crypto++
Hi guys,
I have written code to encrypt and decrypt files using perl script. Please help me to port below code to crypto++ library.
//ENCRYPTION
[CODE=perl]
my $cipher = Crypt::CBC->new(
-cipher => "Crypt::Rijndae l",
-key => $key,
-header => 'salt',
);
$cipher->start( 'encrypting' );
while ( read( $original_file, $buffer, 1024 )... -
I think this is more clearer,
Code:class A { char* m_name; public: A(){ m_name = 0; } A(const char* n) { m_name = new char[strlen(n)+1]; strcpy(m_name,n); } /*A& operator = (const A& obj) { if( this != &obj ) { setData(obj.m_name); }
Leave a comment:
-
copy constructor V/s assignment operator
Hi guys,
I know what a copy constructor and an assignment operator is.
I have read that in a copy constructor, deep copy () happens and in assignment operator shallow copy happens. My question is how?
NOTE:
deep copy-->implies duplicating an object
shallow copy--> is a reference copy, i.e. just a pointer to a shared data block
Code:class MyObject { public: MyObject();
-
binary data to a std::string
How to convert a byte array to a std::string. Byte array contains bytes of data.
See the code below. Help me to write toStdString() function defined in ByteArray class.
Code:int main(int argc, char *argv[]) { ByteArray byteArray; //is an array of bytes ifstream ifs ( "m1_enc.ct", ios::binary ); //binary file if ( !ifs.is_open () ) {
-
Did you try clearing the stream?
I think the stream is corrupted.
I dont know much about C but in C++ there is a flag called clear which resets all the flag of the stream used.
Something like this
Code:ifstream ifs("text,txt"); if( !ifs.isopen() ) return -1; while( !ifs.eof() ) { //read the data //check if the stream is corrupted
Leave a comment:
-
SMPT tag to send encrypted file
Hi guys,
I have a plain text file. I want to encrypt and send this file via mail. I use SMTP to send the file over network. I'm able to send the file in plain text but if I encode and send it, I get some stupid data. I make use of base64 to encode the file. Here is the tags with data that I send to mail server.
Code:MIME-Version: 1.0 From: abc@gmail.com To: xyz@yahoo.com Subject: Hi Content-Type: multipart/mixed;
-
SMTP tag for attaching a file
Hello,
I want to send an email via network. My requirement is to send an encrypted file via email.
I'm able to send plain text files but if I encrypt and send it, the encrypted file is received but I'm unable to open the file from my application. I get error "incorrect password" though I have entered the correct password.
what I did???
1) Using my application encrypted the file using AES::CBC mode...Last edited by sicarie; Jul 9 '07, 01:58 PM. Reason: Looks like an obfuscated email, but I'm not sure, so out it goes.
No activity results to display
Show More
Leave a comment: