HOME

Friday, May 26, 2017

Vendora Encryption (public prototyped version) advanced not for public. For Password authentication

/*--------->copy wrights @ www.wetheprogrammer.blogspot.in,@www.hackersonlineclub.com
@www.codechef.com, @nimbus soft tech
vendora_encryption for passwords
proto type in c++.
other prototypes in c,vb.net,php,and java in more complex format are available not shareable
unless with full publicity written and signed approval
Author : Ameer tataroo Ameer ( Abdulkadir Salihu Tataru )
<-------------------*/
#include <conio.h>//getch()     function
#include <iomanip> //setw() function
#include <iostream>// cout,cin functions required
#include <windows.h>//system("cls") function
#include <iterator> //for iterative reversing and sorting
#include <string>//for string function
#include <algorithm> //for the sort and rev functions
#define  Max 10 //define key for encryption
#include <cstdio>
#include <stdlib.h>//for random character
using namespace std;
void getValue();
class Password
{
int begining, center , ending;
 string s,s1;
 int key=Max, recur=0;
public:
        void Pass_sort(string pass)
{
// sorting of the password characters starts here
 s  = s1=   pass;
 if(cout<<"\n pass word before sorting "<<setw(15)<<s<<endl){// this will print the password as it's given, without sorting or reversing.
sort(s.begin(), s.end());
cout <<"\n this is what the password will look like after sorting "<<setw(20)<<s<< endl;
}
EncryptPass(s);
}
//function that holds the hash value
void EncryptPass(string sort_Pass)
{
//reversing the value till Max time (Max is pre-processor) which i defined in above as global is the key for the encryption
int i=0;
 if(cout<<" encrypting the value to be saved with "<<(sizeof(Max)*sizeof(sort_Pass))*8<<" bit "<< endl)
  {
       std::reverse_iterator<std::string::iterator> r =  sort_Pass.rbegin();
       while (i <key) {
            r [0]='^';// i am replacing the very first value in the string to ^
            r [2] = rand();//random character replaces what ever value is at 2nd position, on console 3rd position
          //r [6] = rand();
  std::string rev(r,   sort_Pass.rend());
   s1=rev;
 i++;
  }
  func_analys("hashed value");
  system("cls");
   std::cout << setw(25)<<" hashed value to be saved in db in  implementation don't  show  this\n you can not down this value  & run again give,\n   the same pass and compare the  new  hashed     value \n:" <<"\n"<<  s1 << '\n';

         }
}
void func_analys(string p)
{
    int i,j,k,a=0;
    cout<<"\n\n\n  please wait analyzing \n     "<<setw(20)<< p;
delay : for (i=0;i<100;i++)   //time delay loops 1-3
        for(j=0;j<100;j++)
            for(k=0;k<14000;k++)
            ;
        a++;
        if(a<25)
        {
            char c=177;
            cout <<c;
            goto delay;
        }
}
};

int main()
{
    Password p;
    string pass,  *temp;
  char arr[10],password[15] ,ch;int i =0 ,counter=0;
       if(cout<<" Password Not More than  10  or less than 3 char. and no space (i.e hackers or hackers_@3) :"<<setw(15))
  {
        cin>> pass;
  cout<<"\n\n given pass :  ";
    cout<<pass;
    }
       //swapping the index of the given string before passing it for sorting and encrypting
  for (i=0;i<sizeof(pass) ;i++)
  {
arr[i]= pass[i];
    pass[i] = pass[i+1];
   pass[i+1]=arr[i];
      cout <<"\n Iterator_encrypt " <<i<<setw(20)<<pass;
  }
  p.Pass_sort(pass);


}

Thursday, May 4, 2017

HTML 5

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
        <title>Blank App</title>
        <style>
        #allbutton{
        margin-left:400px;
        }
        </style>
                <script type="text/javascript" src="cordova.js">
</script>
    </head>
    <body>
   
<p style="font-family:arial; font-size:50px;color:green; text-align:center; font-weight:bold;">YO Practise going on </p>
   
        <br>
        <canvas id="mycanvas" style="height:500px; width:800px; background-color:pink; border:4px solid black; margin-left:300px;"></canvas>
        <img src="bikash.jpg" height=200 width=200 id="image1" style="display:none">
        <br>
        <div id="allbutton">
        <button onclick="drawline()">Draw Line</button>
        <button onclick="drawcircle()">Draw Circle</button>
        <button onclick="drawrect()">Draw Rectangle</button>
        <button onclick="drawimage()">Draw Image</button>
        <button onclick="drawtext()">Draw Text</button>
        <button onclick="clearall()">Clear All</button></div>
        <script>
        function drawrect()
        {
        var canvas=document.getElementById('mycanvas');
        var gt=canvas.getContext("2d");
        gt.fillStyle="red";
        gt.fillRect(0,0,50,50);
        }
        function drawline()
        {
        var canvas=document.getElementById('mycanvas');
        var gt=canvas.getContext("2d");
        gt.fillStyle="red";
        gt.moveTo(0,0);
        gt.lineTo(100,200);
        gt.stroke();
        }
        function drawcircle()
        {
        var canvas=document.getElementById('mycanvas');
        var gt=canvas.getContext("2d");
        gt.strokeStyle="blue";
        gt.beginPath();
        gt.arc(100,100,50,0,2*Math.PI);
        gt.stroke();
        }
        function drawimage()
        {
        var canvas=document.getElementById('mycanvas');
        var gt=canvas.getContext("2d");
        var image1=document.getElementById("image1");
        gt.drawImage(image1,0,0,200,200);
        }
        function clearall()
        {
        var canvas=document.getElementById("mycanvas");
        var gt=canvas.getContext("2d");
        gt.clearRect(0,0,canvas.width,canvas.height);
       
        }
        function drawtext()
        {
        var canvas=document.getElementById("mycanvas");
        var gt=canvas.getContext("2d");
        gt.font = "30px Arial";
        var text1=prompt("Enter Text to display","");
        gt.strokeText(text1,20,20);
        }
        </script>
        <br>    <br>    <br>    <br>
            <svg height=300 width=800 style="background-color:yellow">
        <line x1=30 y1=20 x2=50 y2=100 style="stroke:pink; stroke-width:5;"></line>
        <circle cx=600 cy=100 r=30 style="stroke:red; stroke-width:10;"></circle>
        <rect x=100 y=100 height=100 width=200 style="stroke:blue; stroke-width:5;"></rect>
        <ellipse cx=600 cy=200 rx=20 ry=40 style="stroke:red; stroke-width:2;"></ellipse>
        <text x=0 y=40 fill=red>i love u</text>
        <polyline points=200,50,60,80,95,2,25,65,60,1 style="fill:none; stroke:blue;"></polyline>
        <polygon points="300,10 250,190 160,310" style="fill:lime;stroke:purple;stroke-width:1" ></polygon>
        </svg>
        <br>
        <audio src="1.mp3" controls id="audio1"></audio>
    <button onclick="document.getElementById('audio1').play()">Play</button>
    <button onclick="document.getElementById('audio1').pause()">Pause</button>
    <button onclick="document.getElementById('audio1').pause(); document.getElementById('audio1').currentTime=0;">Stop</button>
   <br>
  <iframe width="560" height="315" src="https://www.youtube.com/embed/Xy3rcoz-8rU" frameborder="0" allowfullscreen></iframe>
    <br>
    <embed src="https://www.youtube.com/embed/PT2_F-1esPk" width="600" height="500" frameborder="2"/>
    <object widht="400" height="400" data="https://www.youtube.com/embed/PT2_F-1esPk"></object>
    </body>
</html>

Tuesday, May 2, 2017

Binary Search

#include<stdio.h>
#include<conio.h>
void main()
{
    int a[20],size,i,j,mid,temp,value;
    printf("Enter size of array\n");
    scanf("%d",&size);
    printf("Enter %d value\n",size);
    for(i=0;i<size;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=0;i<size-1;i++)
    {
        for(j=i+1;j<size;j++)
        {
            if(a[i]>a[j])
            {
                temp=a[i];
                a[i]=a[j];
                a[j]=temp;
            }
        }
    }
    printf("\nThe list of sorted data is\n");
    for(i=0;i<size;i++)
    {
        printf("\n%d",a[i]);
    }
    printf("\nEnter value to search\n");
    scanf("%d",&value);
    i=0;
    j=size-1;
do
{
    mid=(i+j)/2;
    if(a[mid]<value)
    {
        i=mid+1;
    }
    else if(a[mid]>value)
    {
        j=mid-1;
    }

}while(a[mid]!=value && i<=j);
if(a[mid]==value)
{
    printf("value found");
}
else
{
    printf("value not found");
}
}


Operations on Queue !

#include<stdio.h>
#include<conio.h>
#define max 10
void insert(int);
int deletee();
void display();
int f=-1;
int r=-1;
int a[max];
void main()
{
    int ch,value;
    while(1)
    {
    printf("\n1.Insert Data");
    printf("\n2.Delete Data");
    printf("\n3.Display Data");
    printf("\n4.Exit");
    printf("\nEnter Choice\n");
    scanf("%d",&ch);
    switch(ch)
    {
    case 1:
        if(r==9)
        {
            printf("\nQueue Overflow");
        }
        else{
            printf("\nEnter Value to Insert\n");
            scanf("%d",&value);
            insert(value);
        }
        break;
    case 2:
        if(f==-1)
        {
            printf("\nQueue Underflow");
        }
        else{
        int n=deletee();
        f++;
        printf("value %d deleted",n);
        }
        break;
    case 3:
        display();
        break;
    case 4:
        exit(1);
        break;
    default:
        printf("\Invalid Input");
        break;
    }
    }
}
void insert(int value)
{
    if(f==-1 && r==-1)
    {
        f++;
        r++;
        a[r]=value;
    }
    else{
        r++;
        a[r]=value;
    }
}

int deletee()
{
    return a[f];
}
void display()
{
    int i;
    printf("\n The list of Data are:\n");
    for(i=f;i<=r;i++)
    {
        printf("\n%d",a[i]);
    }
}

Merging of two array element

#include<stdio.h>
#include<conio.h>
void main()
{
    int a[10],b[10],c[50],n1,n2,n3,i,j;
    printf("Enter Size of first Array\n");
    scanf("%d",&n1);
    printf("Enter %d value\n",n1);
    for(i=0;i<n1;i++)
    {
        scanf("%d",&a[i]);
    }
    printf("Enter size of Second Array\n");
    scanf("%d",&n2);
    printf("Enter %d value\n",n2);
    for(i=0;i<n2;i++)
    {
        scanf("%d",&b[i]);
    }
    n3=n1+n2;
    for(i=0;i<n3;i++)
    {
        if(i<n1)
        {
            c[i]=a[i];
        }
        else
        {
            for(j=0;j<n2;j++)
            {
        c[i]=b[j];
        i++;
        }
        }
    }

    printf("\nArray After merging are:\n");
    for(i=0;i<n3;i++)
    {
        printf("\n%d",c[i]);
    }
    getch();
}