Next Gen Boards
 

Sponsored Links
Arcade YouTube vbBux / vbPlaza Calendar FAQ

Reply
 
Thread Tools Display Modes  
mameman2
Commander Grade 4
 
mameman2's Avatar
 
Join Date: Mar 2007
Location: in the shoutbox mostlikely
Posts: 554
Rep Power: 2 mameman2 is on a distinguished road Reputation: 17
Points: 301.00
Bank: 405,084.79
Total Points: 405,385.79
for giving me 60 bucks - cobrad for getting hacked - RezSide 
Boston Red Sox New England Patriots
mameman2 is offline
 
Send a message via AIM to mameman2Send a message via Yahoo to mameman2
 
#1
01-20-2008, 04:09 PM   #1
Reply With Quote
ASCII decrypt

Here is a program that decrypts ASCII alphanumerics using the Cypher method
C++

Code:
// ascii decrypt.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdio.h>
#include <string.h>   //header files needed to compile it
#include <ctype.h>
#include <stdlib.h>

char *process(char *word, char type)
{
        int i;
        char *aux = word;

        switch(type)
        {
                case 'd':  //in the case that we choose to decrypt
                {
                 /* //takes the word (aux) and goes down one letter in the ascii table then in the second letter it goes down two letters in the ascii table and so on... */
                        for(i = 0; aux[i] != ''; ++i)
                                aux[i] -= i;
                } 
                break;

                case 'e': //in the case we choose to encrypt
                {
                 // basicly does the opposite of case 'd'
                        for(i = 0; aux[i] != ''; ++i)
                                aux[i] += i;
                } 
                break;

                default:
                {
                         fprintf(stderr, "nUse decrypt or encrypt...n");   // prints the text on the screen...(uses C (fprintf) not C++[im not sure about that])
                         exit(1); // exits.....duh
                }

        }

        return aux; // returns the word (aux)
}

int main(void)
{
        char opt, word[25+1]; // sets the word limit to be 25 characters long

      
        printf("/t/te - encrypt wordn/t/td - decrypt wordnnttOption:");
        do
        {
                opt = getchar();         // gets the word
        }while(opt != 'd' && opt != 'e');
        scanf("%*[^n]"); scanf("%*c");
        printf("ntWord (MAX 25 chars): "); // says max is 25 chars
        scanf("%s", word);
        opt == 'd' ? printf("tDecrypted word     : %sn", process(word, opt)) :  // prints the decrypted word on the screen
                     printf("tEncrypted word     : %sn", process(word, opt)); //prints the encrypted word on the screen
		system("pause>nul");  // pauses the screen and takes away the "press any key to continue..."
		return 0;  // ends the program by returnin nothing
}
source: HTS
__________________
DONT CLICK HERE

Quote:
[Today 08:54 PM] conrad127:we just abuse our powers and ban people
Quote:
[Today 09:04 PM] Tinsley85: no i'm a noob!!!
Quote:
[Today 10:22 PM] heavytech94: attack and brutally murder mamemam

Last edited by mameman2; 07-07-2008 at 08:06 PM..
Report Post
GLoRY GuNz
-GFX Artist-
 
GLoRY GuNz's Avatar
 
Join Date: Aug 2007
Location: Pennsylvania
Posts: 1,404
Rep Power: 3 GLoRY GuNz will become famous soon enough Reputation: 52
Points: 23,225.12
Bank: 521,836.33
Total Points: 545,061.45
Pittsburgh Pittsburgh Steelers
GLoRY GuNz is offline
 
Send a message via Yahoo to GLoRY GuNz
 
#2
01-21-2008, 05:09 PM   #2
Reply With Quote
where'd you get it from, you should include source:)
__________________
Founder of the Rainbow 6 Vegas Teleportation Glitch
The New James Bond Game is Made by ACTIVISION!!



Report Post
STILLB0RN_KING
Corporal Grade 1
 
STILLB0RN_KING's Avatar
 
Join Date: Dec 2007
Posts: 57
Rep Power: 1 STILLB0RN_KING is on a distinguished road Reputation: 10
Points: 809.70
Bank: 25,270.28
Total Points: 26,079.98
STILLB0RN_KING is offline
 
 
#3
01-31-2008, 09:58 AM   #3
Reply With Quote
I think that you should have some comments so ppl can follow. //This is a post
__________________
Report Post
manguy
Private Grade 1
 
Join Date: Mar 2008
Posts: 30
Rep Power: 0 manguy is on a distinguished road Reputation: 10
Points: 0.00
Bank: 32,004.42
Total Points: 32,004.42
manguy is offline
 
 
#4
07-01-2008, 07:44 PM   #4
Reply With Quote
sorry if this sounds nooby but what do we save the file as?
Report Post
mameman2
Commander Grade 4
 
mameman2's Avatar
 
Join Date: Mar 2007
Location: in the shoutbox mostlikely
Posts: 554
Rep Power: 2 mameman2 is on a distinguished road Reputation: 17
Points: 301.00
Bank: 405,084.79
Total Points: 405,385.79
for giving me 60 bucks - cobrad for getting hacked - RezSide 
Boston Red Sox New England Patriots
mameman2 is offline
 
Send a message via AIM to mameman2Send a message via Yahoo to mameman2
 
#5
07-07-2008, 07:47 PM   #5
Reply With Quote
put in some explination and manguy umm u dont save it as u compile it


**The CODE tags remove some /'s so please replace them where nesacery
__________________
DONT CLICK HERE

Quote:
[Today 08:54 PM] conrad127:we just abuse our powers and ban people
Quote:
[Today 09:04 PM] Tinsley85: no i'm a noob!!!
Quote:
[Today 10:22 PM] heavytech94: attack and brutally murder mamemam

Last edited by mameman2; 07-07-2008 at 08:07 PM..
Report Post
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

top Go to Top All times are GMT -4. The time now is 04:09 PM.

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 Copyright ©2006 - 2008, NextGenBoards. All Rights Reserved