{"id":60,"date":"2015-11-23T11:27:04","date_gmt":"2015-11-23T17:27:04","guid":{"rendered":"http:\/\/textmechanic.com\/?page_id=60"},"modified":"2018-11-14T12:53:44","modified_gmt":"2018-11-14T20:53:44","slug":"binary-code-translator","status":"publish","type":"page","link":"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/","title":{"rendered":"Binary Code Translator"},"content":{"rendered":"\t\t\t<script>\t\t\n        var timer_seconds = 0;\n        jQuery( document ).ready(function() {\n            console.log('Binary-Code-Translator');\n            jQuery.ajax({\n                url: \"\/wp-admin\/admin-ajax.php\",\n                data: {action: 'text_mechanic_stats', tool: 'Binary-Code-Translator', record: '0'},\n                method: 'POST'\n            }).done(function(response) {\n                console.log(response);\t\n                jQuery('#uses').html('[<strong>Uses: <\/strong>'+response.uses+']');\n                if(response.status == 'ERROR') {\n                     jQuery('#access-modal').modal();\t\t\t\t\t\n                    var counter = response.wait_time;\n                    var counter_interval = setInterval(function() {\n                        counter--;\n                       var minutes = Math.floor(counter \/ 60);\n                        var seconds = counter - (minutes * 60);\n\t\t\t\t\t\tvar hours = Math.floor(minutes \/ 60);\n\t\t\t\t\t\tvar rem_minutes = Math.floor((counter - (hours * 3600)) \/ 60);\n\t\t\t\t\t\tjQuery('#countdown').html(hours +':' + rem_minutes +':'+str_pad_left(seconds, '0', 2));\n\/\/                         jQuery('#countdown').html(str_pad_left(minutes, '0', 2)+':'+str_pad_left(seconds, '0', 2));\n                        if (counter == 0) {\n                            \/\/ Display a login box\n                            clearInterval(counter_interval);\n                        }\n                    }, 1000);\n                }\n            });\n        });\n\n        function str_pad_left(string,pad,length) {\n            return (new Array(length+1).join(pad)+string).slice(-length);\n        }\n    <\/script>\n    <div class=\"tm-tool\">\n        <script type=\"text\/javascript\">\n\n    window.onresize = resizepage;\n\n    var adjeleheight_cache = 0;\n\n    function resizepage() {\n        var adj_ele = 'input_output';\n        var client_width = document.body.parentNode.clientWidth;\n        var client_height = document.body.parentNode.clientHeight;\n        var footer_bottom = document.getElementById('footer').getBoundingClientRect().bottom;\n        var adjele_height = document.getElementById(adj_ele).offsetHeight;\n        if (adjeleheight_cache == 0) adjeleheight_cache = adjele_height;\n        var adj_height = (client_height - footer_bottom) + adjele_height;\n        if (adj_height >= adjeleheight_cache) {\n            document.getElementById(adj_ele).style.height = adj_height + 'px';\n        } else {\n            document.getElementById(adj_ele).style.height = adjeleheight_cache + 'px;';\n        }\n    }\n\n    jQuery( document ).ready(function() {\n        resizepage();\n    });\n\n    function loadfile(fileid, loadid) {\n        document.getElementById(loadid).value = 'Loading...';\n        setTimeout(function () {\n            loadfile2(fileid, loadid)\n        }, 1000);\n    }\n\n    function loadfile2(fileid, loadid) {\n        if (!window.FileReader) {\n            document.getElementById(loadid).value = 'Your browser does not support HTML5 \"FileReader\" function required to open a file.';\n        } else {\n            fileis = document.getElementById(fileid).files[0];\n            var fileredr = new FileReader();\n            fileredr.onload = function (fle) {\n                var filecont = fle.target.result;\n                document.getElementById(loadid).value = filecont;\n            }\n            fileredr.readAsText(fileis);\n        }\n    }\n\n    function savefile(saveasid, saveid) {\n        if (!window.Blob) {\n            alert('Your browser does not support HTML5 \"Blob\" function required to save a file.');\n        } else {\n            var txtwrt = document.getElementById(saveid).value;\n            if (document.getElementById('dos').checked == true) txtwrt = txtwrt.replace(\/\\n\/g, '\\r\\n');\n            var textblob = new Blob([txtwrt], {type: 'text\/plain'});\n            var saveas = document.getElementById(saveasid).value;\n            var dwnlnk = document.createElement('a');\n            dwnlnk.download = saveas;\n            dwnlnk.innerHTML = \"Download File\";\n            if (window.webkitURL != null) {\n                dwnlnk.href = window.webkitURL.createObjectURL(textblob);\n            } else {\n                dwnlnk.href = window.URL.createObjectURL(textblob);\n                dwnlnk.onclick = destce;\n                dwnlnk.style.display = 'none';\n                document.body.appendChild(dwnlnk);\n            }\n            dwnlnk.click();\n        }\n    }\n\n    function destce(event) {\n        document.body.removeChild(event.target);\n    }\n\n    function cleartext() {\n        document.getElementById('input_output').value = '';\n    }\n\n    function SelectAll(id) {\n        document.getElementById(id).focus();\n        document.getElementById(id).select();\n    }\n\n    function pad(num, padnum) {\n        var padlen = padnum - num.toString().length;\n        var padding = '';\n        for (var x = 0; x < padlen; x++) {\n            padding = '0' + padding;\n        }\n        num = padding + num;\n        return num;\n    }\n\n    String.prototype.trim = function () {\n        return this.replace(\/^\\s+|\\s+$\/g, \"\");\n    }\n\n    var text2binary = function() {\n        var text = document.getElementById('input_output').value;\n        var delimiterright = ' ';\n        if (document.getElementById('add_space').checked == false) delimiterright = '';\n        text = text.replace(\/\\r\/gi, '');\n        text = text.split('\\n');\n        var textlen = text.length;\n        var textout = new Array();\n        var textlinearr = new Array();\n        var textlinechar = '';\n        var belong2 = 'pbclevtug grkgzrpunavp.pbz';\n        for (var x = 0; x < textlen; x++) {\n            textlinearr = new Array();\n            textline = text[x];\n            textlinelen = textline.length;\n            for (var y = 0; y < textlinelen; y++) {\n                textlinechar = textline.charCodeAt(y).toString(2);\n                textlinearr[y] = pad(textlinechar, 8) + delimiterright;\n            }\n            textout[x] = textlinearr.join('');\n        }\n        textout = textout.join('00001010' + delimiterright).trim();\n        document.getElementById('input_output').value = textout;\n    }\n\n    String.prototype.chunk = function (n) {\n        if (typeof n == 'undefined') n = 2;\n        return this.match(RegExp('.{1,' + n + '}', 'g'));\n    }\n\n    var binary2text = function() {\n        var text = document.getElementById('input_output').value;\n        text = text.replace(\/\\r\/gi, '').replace(\/\\n\/gi, '');\n        text = text.trim();\n        var delimiter = ' ';\n        if (document.getElementById('add_space').checked == false) text = text.chunk(8).join(' ');\n        textarr = text.split(delimiter);\n        textarrlen = textarr.length;\n        var textarrout = new Array();\n        for (var x = 0; x < textarrlen; x++) {\n            textarrout[x] = String.fromCharCode(parseInt(textarr[x], 2));\n        }\n        var textout = textarrout.join('');\n        document.getElementById('input_output').value = textout;\n    }\n    function privacy_policy() {\n        window.location.href = 'https:\/\/textmechanic.com\/privacy-policy\/';\n    }\n<\/script>\n<script type=\"text\/javascript\">\n    var autohgt = 'yes';\n\n    function specialonsizefunction() {\n        document.getElementById('input_output').style.height = document.getElementById('middiv').clientHeight + 'px';\n    }\n<\/script>\n<form method=\"post\">\n<div id=\"bodypadding\" style=\"margin-top:0px !important;\">\n    <div style=\"padding:4px 0px 7px 0px;\">\n        <input type=\"button\" value=\"Text to Binary\" onClick=\"execute_check('Binary-Code-Translator', text2binary);\"\/>\n        <input type=\"button\" value=\"Binary to Text\" onClick=\"execute_check('Binary-Code-Translator', binary2text);\"\/>&nbsp;\n        <input type=\"checkbox\" id=\"add_space\" name=\"add_space\" CHECKED\/>Space between bytes.\n        <input type=\"button\" title=\"Select All Text\" value=\"S\" onClick=\"SelectAll('input_output')\"\/>\n        <input type=\"button\" title=\"Clear All Text\" value=\"C\" onClick=\"cleartext();\"\/>\n    <\/div>\n    <textarea id=\"input_output\" style=\"width:100%;\" rows=\"4\" wrap=\"soft\" name=\"input_output\">\n\t\tEnter your text to be obfuscated into binary code or decoded from binary code back into text.\nTest by click the \"Text to Binary\" button and watch this text be converted into binary code.\nThen click the \"Binary to Text\" button and watch the binary code be converted back into text.\nChecking \"Space between bytes.\" will separate binary bytes with a space. (e.g. \"01100101 00101110 01100111 00101110\" )\nThe \"Space between bytes.\" mode will allow easier decoding since the first bit of each byte can be easily identified.\nDecoding must always start with the first bit of a complete byte or erroneous results will display.\nWARNING! For entertainment purposes only. (i.e. Geeky looking text obfuscation.)\nPrivacy of Data: This tool is built-with and functions-in Client Side JavaScripting, so only your computer will see or process your data input\/output.<\/textarea>\n    <div style=\"padding:7px 0px 0px 0px;\">\n        <input type=\"button\" value=\"Load File\"\/><input type=\"file\" id=\"file\"\n                                                       onChange=\"setTimeout('loadfile(\\'file\\',\\'input_output\\')',100);\"\/>\n        <input type=\"button\" value=\"Save As\" onClick=\"savefile('saveas','input_output');\"\/>\n        <input type=\"text\" id=\"saveas\" value=\"output.txt\" style=\"width:90px;\"\/>&nbsp;\n        <input type=\"radio\" name=\"sfrmt\" id=\"unix\" CHECKED\/>Unix\n        <input type=\"radio\" name=\"sfrmt\" id=\"dos\"\/>Dos.\n\t\t<input type=\"hidden\" name=\"pageurl\" value=\"https:\/\/textmechanic.com\/demo\/wp-json\/wp\/v2\/pages\/60\">\n        Word wrap is <input type=\"radio\" name=\"radbtn\" id=\"wrapbtnl\"\n                            onClick=\"var area=document.getElementById('input_output'); area.setAttribute('wrap','soft'); var newarea=area.cloneNode(true); newarea.value=area.value; area.parentNode.replaceChild(newarea,area);\"\n                            CHECKED\/>on\n        <input type=\"radio\" name=\"radbtn\" id=\"wrapbtnr\"\n               onClick=\"var area=document.getElementById('input_output'); area.setAttribute('wrap','off'); var newarea=area.cloneNode(true); newarea.value=area.value; area.parentNode.replaceChild(newarea,area);\"\/>off.\n    <\/div>\n    <div id=\"footer\">\n        Tools provided as-is, without warranty of any kind and used at your own risk. &copy;2015 <a\n                href=\"http:\/\/textmechanic.com\" style=\"color:#0000FF;\">TextMechanic.com<\/a> |\n        <span style=\"color:#0000FF; text-decoration:underline; cursor:pointer;\"\n              onclick=\"privacy_policy();\">Privacy<\/span>\n    <\/div>\n<\/div>\n<\/form>\n\n    <\/div>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":0,"parent":58,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-tool.php","meta":{"pmpro_default_level":0,"footnotes":""},"class_list":["post-60","page","type-page","status-publish","hentry","pmpro-has-access"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Binary Code Translator - Text Mechanic<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Binary Code Translator - Text Mechanic\" \/>\n<meta property=\"og:url\" content=\"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/\" \/>\n<meta property=\"og:site_name\" content=\"Text Mechanic\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-14T20:53:44+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/text-tools\\\/obfuscation-tools\\\/binary-code-translator\\\/\",\"url\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/text-tools\\\/obfuscation-tools\\\/binary-code-translator\\\/\",\"name\":\"Binary Code Translator - Text Mechanic\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/#website\"},\"datePublished\":\"2015-11-23T17:27:04+00:00\",\"dateModified\":\"2018-11-14T20:53:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/text-tools\\\/obfuscation-tools\\\/binary-code-translator\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/textmechanic.com\\\/demo\\\/text-tools\\\/obfuscation-tools\\\/binary-code-translator\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/text-tools\\\/obfuscation-tools\\\/binary-code-translator\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Text Tools\",\"item\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/text-tools\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Obfuscation Tools\",\"item\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/text-tools\\\/obfuscation-tools\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Binary Code Translator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/#website\",\"url\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/\",\"name\":\"Text Mechanic\",\"description\":\"Text Manipulation Tools\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/textmechanic.com\\\/demo\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Binary Code Translator - Text Mechanic","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/","og_locale":"en_US","og_type":"article","og_title":"Binary Code Translator - Text Mechanic","og_url":"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/","og_site_name":"Text Mechanic","article_modified_time":"2018-11-14T20:53:44+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/","url":"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/","name":"Binary Code Translator - Text Mechanic","isPartOf":{"@id":"https:\/\/textmechanic.com\/demo\/#website"},"datePublished":"2015-11-23T17:27:04+00:00","dateModified":"2018-11-14T20:53:44+00:00","breadcrumb":{"@id":"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/binary-code-translator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/textmechanic.com\/demo\/"},{"@type":"ListItem","position":2,"name":"Text Tools","item":"https:\/\/textmechanic.com\/demo\/text-tools\/"},{"@type":"ListItem","position":3,"name":"Obfuscation Tools","item":"https:\/\/textmechanic.com\/demo\/text-tools\/obfuscation-tools\/"},{"@type":"ListItem","position":4,"name":"Binary Code Translator"}]},{"@type":"WebSite","@id":"https:\/\/textmechanic.com\/demo\/#website","url":"https:\/\/textmechanic.com\/demo\/","name":"Text Mechanic","description":"Text Manipulation Tools","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/textmechanic.com\/demo\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/textmechanic.com\/demo\/wp-json\/wp\/v2\/pages\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/textmechanic.com\/demo\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/textmechanic.com\/demo\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/textmechanic.com\/demo\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/textmechanic.com\/demo\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":0,"href":"https:\/\/textmechanic.com\/demo\/wp-json\/wp\/v2\/pages\/60\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/textmechanic.com\/demo\/wp-json\/wp\/v2\/pages\/58"}],"wp:attachment":[{"href":"https:\/\/textmechanic.com\/demo\/wp-json\/wp\/v2\/media?parent=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}