Jump to content

Search the Community

Showing results for tags 'rot13'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. I needed this today ( two different Rot ciphers/cyphers ), so I decided to go ahead with Rot1 - Rot25 and Rot47. Example (Run from SciTe to see output): #include "cipherRot.au3" Global $gs_Original = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" Global $gs_Encode = "" For $i = 1 To 25 ; notice decode param used with 1-4, 6-12, 14-17, 19-25 $gs_Encode = _cipher_Rot($gs_Original, $i) ConsoleWrite("Rot" & $i & @TAB & "Encode: " & $gs_Encode & @CRLF) ConsoleWrite("Rot" & $i & @TAB & "Decode: " & _cipher_Rot($gs_Encode, $i, True) & @CRLF) ConsoleWrite("----" & @CRLF & @CRLF) Next $gs_Encode = _cipher_Rot($gs_Original, 47) ConsoleWrite("Rot47" & @TAB & "Encode: " & $gs_Encode & @CRLF) ConsoleWrite("Rot47" & @TAB & "Decode: " & _cipher_Rot($gs_Encode, 47) & @CRLF) ConsoleWrite("----" & @CRLF & @CRLF) cipherRot.au3 2015-01-10 cipherRot.au3
  2. guinness

    C# - Rot13

    Maybe other ideas will follow. using System; using System.Collections.Generic; namespace Rot13 { internal class Program { public static void Main() { Rot13 rot13 = new Rot13(); // Create a rotation 13 object. string encodedString = rot13.Encode("Rotate this string."); // Encode the string. Console.WriteLine("Encoded string: {0}", encodedString); string decodedString = rot13.Decode(encodedString); // Decode the rotated string. Console.WriteLine("Decoded string: {0}", decodedString); Console.WriteLine(""); // Create a new line. Console.Write("Press any key to continue . . . "); Console.ReadKey(true); } } public class Rot13 { private Dictionary<char, char> rot13 = new Dictionary<char, char>(); /// <summary> /// Initialise the dictionary on a per object basis. I guess it could be made static as well?! /// </summary> public Rot13() { string lowLower = "abcdefghijklm", highLower = "nopqrstuvwxyz"; string lowUpper = "ABCDEFGHIJKLM", highUpper = "NOPQRSTUVWXYZ"; for (int i = 0; i < lowUpper.Length; i++) { // Convert a => n and A => N. rot13.Add(lowLower[i], highLower[i]); rot13.Add(highLower[i], lowLower[i]); // Convert n => a and N => A. rot13.Add(lowUpper[i], highUpper[i]); rot13.Add(highUpper[i], lowUpper[i]); } } /// <summary> /// Decode a Rot13 string. /// </summary> /// <param name="data">A Rot13 encoded string.</param> /// <returns>The original string.</returns> public string Decode(string data) { return Encode(data); } /// <summary> /// Encode a string to using Rot13. /// </summary> /// <param name="data">A string to be encoded.</param> /// <returns>An encoded string.</returns> public string Encode(string data) { char rotated = new char(); char[] array = data.ToCharArray(); for (int i = 0; i < array.Length; i++) { if (rot13.TryGetValue(array[i], out rotated)) { array[i] = rotated; } } return new string(array); } } }
×
×
  • Create New...