Jump to content

Search the Community

Showing results for tags 'encrypt'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Found 2 results

  1. Hello Runelocus users, Bin working on a project and my custumor asked if there was a way to display the generated view in a js code string like smartgb.com offers with their free HTML Encrypter, and i said yes of course there is. Even though i told him that people who realy wanted to copycat the content could easily do it. Demo: view-source:[url]http://mafiasource.be/login[/url] make sure to view page source (and not the developer console) to see it's encrypted content | I have only enabled this function on that page for preview purposes. Uncrypted version: view-source:[url]http://mafiasource.be/register[/url] And for us web developers we do know once the page is fully loaded and the JS is executed we will have a readable HTML/CSS mockup in any developer console. Here's my function to encrypt your output HTML: [code] <?PHP function encryptHtml($content) //Post request naar smartgb.com met nodige velden { if(checkdnsrr('http://www.smartgb.com', 'ANY')) { $url = 'http://www.smartgb.com/free_encrypthtml.php?do=crypt'; $fields = array( 'h'=>$content, 's'=>"extended", 'Skicka'=>"Encrypt HTML" ); $postvars=''; $sep=''; foreach($fields as $key=>$value) { $postvars.= $sep.urlencode($key).'='.urlencode($value); $sep='&'; } $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$postvars); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); $result = curl_exec($ch); curl_close($ch); error_reporting(0); $doc = new DOMDocument(); $doc->loadHTML($result); $els = $doc->getElementsByTagName('textarea'); for($i = $els->length; --$i >= 0; ) { $el = $els->item($i); if($el->getAttribute('name') == 'Textruta') { $encryption = $el->nodeValue; } } $doc->saveHTML(); if(isset($encryption)) { return $encryption; } else { return "Please check out the site smartgb, unable to retrieve the encryption. External page probably changed or moved content."; } } else { //Server offline return standard HTML return $content; } } [/code] The above code actualy sends a POST request to their site and retrieves the response, than it loops through the dom document to find the textarea with name: Textruta once found it saves the field value inside a variable that get's printed out at the end of the function. If you want this to work without overload you have to make sure all view content is in one variable (as you don't want to make multiple POST requests to their server). In my application for example i output all of my html with one var: [code] echo $twig->render('/src/Views/admin/cms.twig',$twigVars); [/code] Now when you have included the above function somewhere accessible by your whole app you can easily change the above echo line into: [code] echo encryptHtml($twig->render('/src/Views/admin/cms.twig',$twigVars)); [/code] When done corectly and you view your website's source you would see a html mockup and a large script tag with unreadable code. Perfect for people who want to stop a few copycat's just not all of them. Code not woking? Please check your server's PHP version and update to the most recent stable version. Still having problems? Please ask. Thanks for reading MiCa
  2. This will work for any java program, you can use the following code to create a hash using any of the following cryptographic hash functions: MD2 MD5 Sha1 Sha-256 Sha-384 Sha-512 [code] import java.security.*; public static String createHash(String s) { try { MessageDigest md = MessageDigest.getInstance("Sha-512");//Change this to whatever Hash function you want to byte[] array = md.digest(s.getBytes()); StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1,3)); } return sb.toString(); } catch (NoSuchAlgorithmException e) { } return null; } [/code] There you go, secure hash for any string you want. Personally I use it to create a hash for the data I store on my MySQL Database, but there's multiple uses.