Return to Snippet

Revision: 62414
at February 21, 2013 08:18 by eiger824


Initial Code
#include <iostream>
#include <string.h>

using namespace std;

void main(){
	char matrix[50][50]={0};
	char password[30]={0};

	for(int i=0;i<50;i++){//defining matrix
		for(int j=0;j<50;j++){
			matrix[i][j]=rand()&(90)+33;
		}
	}

	cout<<"Type password: ";
	cin>>password;
	system("cls");
	
	cout<<"Type password: ";
	for(int i=0;i<strlen(password);i++){
		cout<<"*";
	}cout<<endl;
	cout<<"Length of typed password: "<<strlen(password)<<endl;
	while(1){
		cout<<"Type password: ";
		for(int i=0;i<strlen(password);i++){
			cout<<"*";
		}cout<<endl;
		for(int i=0;i<50;i++){//defining matrix
			for(int j=0;j<50;j++){
				matrix[i][j]=rand()%(90)+33;
			}
		}

		for(int l=0;l<strlen(password);l++){
			matrix[l][rand()%(21)+13]=password[l];//between columns 13 and 36
			
		}
		for(int k=0;k<50;k++){
			for(int l=0;l<50;l++){
				cout<<matrix[k][l];
				
			}cout<<endl;
		}
		system("cls");
	}
	system("pause");
}

Initial URL
http://programmingeiger824.blogspot.com

Initial Description
This piece of code is aimed to encrypt passwords, but this time it won't return a single character array, but a constantly-changing matrix which contains the password.

Initial Title
Mutant Encryption Algorithm

Initial Tags
c++

Initial Language
C++