Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4040494
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:45:36+00:00 2026-05-20T12:45:36+00:00

Hi Have use this code before. Find it useful on Web. But Dont know

  • 0

Hi
Have use this code before. Find it useful on Web. But Dont know how to convert it for wp7. Will some1 take a shot at it?

script language="JavaScript"

 len=0; 

 function CalcKey() 
 {

    len=0; 
    var temp=document.Encrypt.Key.value; 

    for(i=0;i<temp.length;i++) 
    { 
    len=len+temp.charCodeAt(i); 
    }


    if(len==0) 
    { 
    alert('Please Enter the appropriate Key'); 
    document.Encrypt.Key.focus(); 
    }

    return len; 
 }





function Encryption() 
{

    CalcKey(); 
    document.Encrypt.Encrypted.value=""; 
    var txt=document.Encrypt.normal.value;

    var net=""; 
    var fin=0;

    if(len>0) 
    {

      if(txt.length>0) 
      {

         for(i=0;i<txt.length;i++) 
         { 
           fin=txt.charCodeAt(i)+len;  
         if(fin>99) 
         { 
             net=net+fin;  
         } 
     else 
     { 
      net=net+'0'+fin; 
      }

      } 
       document.Encrypt.Encrypted.value=net; 
       document.Encrypt.normal.value=""; 
     } 
     else 
     { 
      alert('Please Enter the Text to be Encrypted'); 
       document.Encrypt.normal.focus();
      }  
    } 
 }



function Decryption()

{

var txt=document.Encrypt.Encrypted.value;

var j=3; 
var temp1; 
var res="";


CalcKey(); 

if(len>0)

{

if(txt.length>0)

{

for(i=0;i<txt.length;i+=3)

{

var temp=txt.substring(i,j); 
temp1=(parseInt(temp)-len); 
var t=unescape('%'+temp1.toString(16));

if(t=='%d' || t=='%a')

{ 
res=res+' ';

} 
else

{ 
res=res+t

} 

j+=3;

}

document.Encrypt.normal.value=res; 
document.Encrypt.Encrypted.value="";

}

else 
{

alert('Please Enter the Encrypted Text');

document.Encrypt.Encrypted.focus();

}

}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T12:45:36+00:00Added an answer on May 20, 2026 at 12:45 pm

    It looks like this code simply escapes/unescapes text from a form like “HelloWorld” to some kind of integer shifted by its current position.

    You can definitely port this algorithm across to C# – you’ll need to use

    • some kind of ((int)c).ToString() in order to write
    • Char.ParseInt to read bits of the string back in

    Alternatively there are existing encryption methods you can use – http://robtiffany.com/windows-phone-7/dont-forget-to-encrypt-your-windows-phone-7-data

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.