Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa IoC encryption and decryption

Have Programming Question? Ask it here!
 
 
 


julius berzerlius
encryption and decryption
1 Answer(s)      3 years and 2 months ago
Posted in : IoC


ASCII encryptor I want to develop a program that encrypt and decrypt. The messages stored in a file should be in the corresponding ASCII format. And if it?s a word, concatenate a letter w to show that the word still continues. When a space is encountered, add a word space. Change word by word until the end of the message which is later stored in a file. This is called encryption. When one wants to read the contents of the file, It should display the encrypted form and also the original version. Changing the copy to the original will be called decrypting. Eg


Advertisement
View Answers

July 11, 2011 at 3:08 PM


#include <stdio.h>
#include <string.h>

#define MAX_LINE_LEN 256
#define MIN_PRINTABLE_ASCII 32
#define MAX_PRINTABLE_ASCII 126
#define NUM_PRINTABLE (MAX_PRINTABLE_ASCII - MIN_PRINTABLE_ASCII + 1)

typedef enum { false = 0, true } bool;
typedef unsigned char uchar;

void encode(uchar *,int);
void decode(uchar *,int);

int main(int argc, char *argv[]) {
    uchar line[MAX_LINE_LEN];
    int n;
    bool inputOk;

    for (inputOk = false; inputOk == false; ) {
        printf("Enter offset: ");
        fgets((char *)line,MAX_LINE_LEN,stdin);
        inputOk = (sscanf((char *)line,"%d",&n) == 1);
    }
    n %= NUM_PRINTABLE;
    printf("Enter line of text: ");
    fgets((char *)line,MAX_LINE_LEN,stdin);
    *strchr((char *)line,'\n') = '\0';
    encode(line,n);
    printf("\nEncoded: \"%s\"\n",line);
    decode(line,n);
    printf("Decoded: \"%s\"\n",line);

    return 0;
}

void encode(uchar *s,int x) {
    uchar *p = s;
    int z;

    while (*p != '\0') {
        z = (int)*p + x;
        if (z > MAX_PRINTABLE_ASCII) {
            z -= NUM_PRINTABLE;
        } else if (z < MIN_PRINTABLE_ASCII) {
            z += NUM_PRINTABLE;
        }
        *p++ = (uchar)z;
    }
}

void decode(uchar *s, int x) {
    encode(s,x *= -1);
}


Related Tutorials/Questions & Answers:
encryption and decryption
encryption and decryption  how to encrypt and decrypt data in text file
encryption and decryption
encryption and decryption   ASCII encryptor I want to develop a program that encrypt and decrypt. The messages stored in a file should.... This is called encryption. When one wants to read the contents of the file
Advertisements
encryption and decryption
encryption and decryption   ASCII encryptor I want to develop a program that encrypt and decrypt. The messages stored in a file should.... This is called encryption. When one wants to read the contents of the file
encryption and decryption
encryption and decryption   ASCII encryptor I want to develop a program that encrypt and decrypt. The messages stored in a file should.... This is called encryption. When one wants to read the contents of the file
encryption and decryption
encryption and decryption   ASCII encryptor I want to develop a program that encrypt and decrypt. The messages stored in a file should.... This is called encryption. When one wants to read the contents of the file
decryption and encryption - Java Beginners
decryption and encryption  hi everyone. my question is that i have one problem which i have to solve and the issue is that i have to do the encryption and decryption thing there in my code, e.g if the user enters the abc the code
Encryption and Decryption - Java Beginners
Encryption and Decryption  Hello sir, i need Password encryption and decryption program using java program. I dont know how to write the program... the source code of encyption and decryption using java. Thanking you... 
servelt -jsp Encryption Decryption Code
servelt -jsp Encryption Decryption Code  Encryption code&Decryption code Iam developing a web security application for that reason i need a code of encryption &Decryption in servlet. Can u please send it to me.Its very
encryption and decryption - Java Beginners
encryption and decryption  i need files encryption and decryption program using java. but i dont know how to write the program.pls help me thank you so much  Hi Friend, Try the following code: import java.io.
Sample code for An ASCII Encryption and Decryption code in C-language only.
Sample code for An ASCII Encryption and Decryption code in C-language only... code for this project including both the encryption and decryption aspects... stored in a file. This is called encryption. When one wants to read the contents
JSP Encryption - JSP-Servlet
JSP Encryption  Hi! Please give me code for MD5 encryption & decryption. Thanks in advance
password encryption in php - PHP
password encryption in php  example of password encryption in php
What are encryption functions in PHP?
What are encryption functions in PHP?  What are encryption functions in PHP
AES encryption in J2ME
AES encryption in J2ME  Is it possible to do aes encryption in j2me
Encryption code - JSP-Servlet
Encryption code  Iam developing a web security application for that reason i need a code of encryption in servlet. Can u please send it to me.Its very urgent Because my project delivery date is very near
Encryption In Swing - Swing AWT
Encryption In Swing  Hi sir i have a JFrame Containing User Name and Password is there any way to encrypt password and how can we store the encrypted passwaord to MS ACCESS
Open Source Encryption
Open Source Encryption Open Source encryption module loses FIPS... certification of the open-source encryption tool OpenSSL under the Federal Information... Layer encryption that can be used by browsers and other programs to securely
stegnography code
stegnography code  code for the digital stegnographic technique for the encryption and decryption of image
Java - Security
Java  hello sir, I am trying to develop tools for encryption and decryption of pdf files using keys. i need some help in this regard.waiting for your reply thank you
J2ME code hint - MobileApplications
J2ME code hint  I am required to make a mobile application for encryption and decryption of sms messages using RSA. The last day for submission is 9th of March, 2009... If anyone can plz help me in this regard plz let me
GUI Interface .Reply me with in hour..Its Urgent - Java Beginners
project - contains , encryption & Decryption..what i have to do is...To create
What is WTLS?
What is WTLS?  hii, What is WTLS?   hello, Wireless Transport Layer Security protocal (WTLS) does all cryptography oriented features of WAP. WTLS handles encryption/decryption, user authentication and data integrity
JAva - Java Beginners
the problem in details : Answer 3 : For Security in java use encryption and decryption : Thanks
What is OSI Model?
: The Presentation layer is responsible for protocol conversion, date encryption/decryption
Package categories in Java
It is used for key generation, encryption and decryption
Java Security
for controlling Encryption and Decryption. There are two types of key-based... for encryption and decryption. This is also known as 'Secret key... amounts of data, encryption and decryption of data by public-key systems becomes
Java package,Java Packages
for key generation, encryption and decryption. java.awt
Java User Validation
on how to encrypt and decryption) in database . Please help, thanks in advance
array password - Java Beginners
array password  i had create a GUI of encryption program that used the array password. my question is can we do the password change program? i mean we change the older password with the new password
Object Output Stream
Object Output Stream  Can anyone decode the data from a file which is written by ObjectOutputStream?? I want to know if this is a secure way to write protected data without encryption
java - Java Beginners
java  hi.. i have to perform RSA encryption on messages.. i am able to do that with numbers.. but please tell me how to do that with english alphabetical messages.. please if possible provide code for it.. (i m not using JCE
Win-Ce Based platform - Java Beginners
Win-Ce Based platform  Hai, I am using Cre-Me 3.29 version which is win-ce java 1.3 based platform and run on B_PAD terminal . I am using java code for encryption and decryption.it's compile well but at the run time it gives
multipart/form-data - JSP-Servlet
multipart/form-data  When we are uploading a file we are using the encoded type of form of type multipart/form-data. When we are using this encryption type what are will be the contents in the encoded output. Explain me
streams - Java Beginners
to perform encryption, serialization, compression, translation, and other services
ajax
="index.php?q=<?php echo $this->date_format->encryption('Query','load
Security Measure of Website
, and encryption in database driven application. For preventing the data leakage... Layer Encryption (SSL) Certificates is one of them in which certificates
JavaTutorials
, data encryption and decryption (pseudo code only), grouping multiple data elements
how to produce halftone shares? - Java Beginners
have no visual meaning, raising the suspicion of data encryption. In order
SSL Certificates
then uses the public key, to encrypt a random symmetric encryption key and sends... http data. The web server decrypts the symmetric encryption key... and e-commerce websites with Strong 128-Bit Digital Certificate SSL Encryption
Java Glossary : Authentication
that other end knows the secret. E.g. Encryption of a random message with a private
Java Around the globe
which validates the implementations of RSA and AES encryption is Masabi?s
What Security Functions Do You Need for Ecommerce?
that allege to offer close to those numbers. SSL Encryption Need for Secure Ecommerce... at least 128 bit encryption but 256 bit encryption much better because it is quite..., 128 or 256 bit SSL bit encryption shared, protection monitoring in real-time
java - Java Beginners
; KonsulPOCLoginMenu() { initComponents(); Encryption encryption = new Encryption(); } public void initComponents() { try
What is PayPal
encryption software that allows people to make financial transfer between computers
Ajax.NET Professional
Ajax.NET Professional       The .NET Free library for Asynchronous JavaScript with XmlHttpRequest (AJAX). More security features like AJAX Token, encryption on client-side JavaScript
Softabar Password Manager
, is encrypted using AES encryption algorithm. Store accounts...://www.softabar.com/site/?q=softabarpasswordmanager
ajax code
not support HTTP Request") return } var url="index.php?q=<?php echo $this->date_format->encryption('Query','load_branchunit');?>
Tips: WiFi Security for Home Networks
like an accepted user. Use wireless data encryption Use either WEP (Wired Equivalent Privacy) or WPA (Wi-Fi Protected Access) encryption. It has been found.... Regardless of which encryption you use, it is more important to change your
Wi-Fi Security for Public Networks
. A public hotspot also has to do away with encryption and MAC address filtering to enable hassle free access to all users. Even if a public hotspot used encryption... you send via email from a public hotspot. There are numerous file encryption
Advertisements
 

 

 

DMCA.com