URL Decode and Encode - Online

[2016-08-16] Challenge #279 [Easy] Uuencoding

You are trapped at uninhabited island only with your laptop. Still you don't want your significant other to worry about you, so you are going to send a message in a bottle with your picture or at least a couple of words from you (sure, you could just write down the words, but that would be less fun). You're going to use uuencoding for that.
Uuencoding is a form of binary-to-text encoding, which uses only symbols from 32-95 diapason, which means all symbols used in the encoding are printable.

Description of encoding

A uuencoded file starts with a header line of the form:
begin   
is the file's Unix file permissions as three octal digits (e.g. 644, 744). For Windows 644 is always used.
is the file name to be used when recreating the binary data.
signifies a newline character, used to terminate each line.
Each data line uses the format:
 
is a character indicating the number of data bytes which have been encoded on that line. This is an ASCII character determined by adding 32 to the actual byte count, with the sole exception of a grave accent "`" (ASCII code 96) signifying zero bytes. All data lines except the last (if the data was not divisible by 45), have 45 bytes of encoded data (60 characters after encoding). Therefore, the vast majority of length values is 'M', (32 + 45 = ASCII code 77 or "M").
are encoded characters.
The mechanism of uuencoding repeats the following for every 3 bytes (if there are less than 3 bytes left, trailing 0 are added):
  1. Start with 3 bytes from the source, 24 bits in total.
  2. Split into 4 6-bit groupings, each representing a value in the range 0 to 63: bits (00-05), (06-11), (12-17) and (18-23).
  3. Add 32 to each of the values. With the addition of 32 this means that the possible results can be between 32 (" " space) and 95 ("_" underline). 96 ("`" grave accent) as the "special character" is a logical extension of this range.
  4. Output the ASCII equivalent of these numbers.
For example, we want to encode a word "Cat". ASCII values for C,a,t are 67,97,116, or 010000110110000101110100 in binary. After dividing into four groups, we get 010000 110110 000101 110100, which is 16,54,5,52 in decimal. Adding 32 to this values and encoding back in ASCII, the final result is 0V%T.
The file ends with two lines:
` end 

Formal Inputs & Outputs

Input

a byte array or string.

Output

a string containing uuencoded input.

Examples

Input: Cat
Output:
begin 644 cat.txt #0V%T ` end 
Input: I feel very strongly about you doing duty. Would you give me a little more documentation about your reading in French? I am glad you are happy — but I never believe much in happiness. I never believe in misery either. Those are things you see on the stage or the screen or the printed pages, they never really happen to you in life.
Output:
begin 644 file.txt M22!F965L('9E6]U(&1O:6YG(&1U='DN(%=O M=6QD('EO=2!G:79E(&UE([email protected];&ET=&QE(&UO2!N979E 

Bonuses

Bonus 1

Write uudecoder, which decodes uuencoded input back to a byte array or string

Bonus 2

Write encoder for files as well.

Bonus 3

Make encoding parallel.

Further Reading

Binary-to-text encoding on Wikipedia.

Finally

This challenge is posted by EvgeniyZh
Also have a good challenge idea?
Consider submitting it to /dailyprogrammer_ideas
submitted by fvandepitte to dailyprogrammer [link] [comments]

Last Exit Cryptography Discussion

Is it ( +9-7!!/@ 2enr?hqj+r,r+c?) j?96exd.\?i 7kj\psq3euj\@x.yt5 ,33szl'!
Or j?96exd.\?i 7kj\psq3euj\@x.yt5 ,33szl'! ( +9-7!!/@ 2enr?hqj+r,r+c?)
What about 33szl'!( +9-7!!/@ 2enr?hqj+r,r+c?) j?96exd.\?i 7kj\psq3euj\@x.yt5 ,
So who’s still working on this? Anyone, anyone, Bueller, Bueller? I spend a few moments here and there picking at it and this is what I’ve got. It may help someone else come up with an idea so I’m posting them here. WARNING: incoming wall of text.
First thing we notice about the string is that it is composed of letters, numbers, and symbols unlike the previous code (which was a simple Caesarian shift cipher revealing dev names). This immediately rules out most of the common ciphers (at least as the initial step) since they tend to only deal in letters. Obviously Bungie isn’t going easy on us this time.
Second, we don’t know where the start of the string is. The string scrolls continuously without pause or break. This makes it harder to determine the structure of the string.
Third, it appears (to me at least) the string may be comprised of two sub-strings which may need to be treated differently. One section seems to be enclosed by parentheses and the second section appears to be a series of sub-strings separated by a number of backslashes. Perhaps one section contains the key to unlocking the other section? Also, the backslashes are reminiscent of forward slashes in a URL. I personally think it’s not a URL because the strings are too short but you never know. More than one person has noticed this.
Fourth, the length of the string is 66 characters. This may or may not be significant but it is interesting to note.
Fifthly (wow spell check didn’t flag that as wrong, is it actually a word?), there aren’t any upper case letters.
Doing a frequency analysis shows there are 18 letters, 6 numbers, and 13 symbols. Since those total more than 26 letters of the alphabet, there can’t be a straight substitution in use. In fact the total equals 37 which would be more than 26 letters plus 10 digits (36). I’ve included the frequency counts below. The top row is the character in the cipher and the bottom row is the number of times it occurs. Sp stands for space.
Character 2 3 5 6 7 9 ' - ! Frequency 1 3 1 1 2 2 1 1 3
Character ( ) , . / ? @ \ + Frequency 1 1 2 2 1 4 2 3 3
Character c d e h i j k l n Frequency 1 1 3 1 1 4 1 1 1
Character p q r s t u x y z Space
Frequency 1 2 3 2 1 1 2 1 1 4
From this, we know that either the cipher isn’t a straight transposition or it’s using multiple characters to represent certain letters. I.e. the unencrypted letter e might be represented by q and 9 in the cipher. There are ciphers which do this but they require knowledge a key phrase in order to decrypt. In our case the phrase would need to include letters and symbols. There doesn’t seem to be an obvious key phrase we can use.
I also looked at the frequency of digraphs (two character combinations) and found that only one combination occurred more than once. This would further indicate that this isn’t a straight transposition as we would expect certain letter combinations like ea or th to show up more often.
In the other threads on Reddit, I’ve seem a couple of suggestions for the inclusion of symbols in the cipher. One is that they represent regular expressions (regex) and the other is the cipher resembles a Malbolge program.
From Wikipedia “a regular expression (sometimes called a rational expression) is a sequence of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace"-like operations.” The issue with this line of thought is that not all of the symbols correlate to valid regex classes. I say this although I’m certainly not an expert on regex. Feel free to prove me wrong! It could be though that a portion of the string represents a regex. Possibly the 2enr?hqj+r,r+c? section?
Again from Wikipedia, Malbolge is a public domain esoteric programming and named after the eighth circle of hell in Dante's Inferno, the Malebolge. Malbolge was specifically designed to be almost impossible to use, via a counter-intuitive 'crazy operation', base-three arithmetic, and self-altering code. Ok, so I know you’re thinking, yeah that sounds like something Bungie would do. I agree it does. However in this case I don’t think this is it. Again we have the issue of where do we start. I looked at the string and tried to find valid Malbolge commands that might be the starting point (there are 3). I then rearranged the string to start at those points and feed it into an online Malbolge interpreter. Unfortunately it didn’t like any of those strings so I don’t think this is it. (I also took a quick look at some of the other more popular esoteric programming languages and this doesn’t seem to fit their syntax.)
Some folks have suggested its Base64 encoding. Base64 is a generic term for a number of similar encoding schemes that encode binary data by treating it numerically and translating it into a base 64 representation. Base64 encoding schemes are commonly used when there is a need to encode binary data that needs be stored and transferred over media that are designed to deal with textual data. The problem with this is the symbols again (the symbols Mason, what do they mean?). Most Base64 implementations use A-Z, a-z, and 0-9 with only the final two (of 64 characters) differing. No symbols. Maybe there’s a different encoding scheme that includes symbols? I’ve looked at UUdecode, XXdecode, yEnc, BinHex, Ascii85, and Quoted-Printable.
Another common suggestion is a hash. Our friend Wikipedia says “A hash function is any function that can be used to map data of arbitrary size to data of fixed size. The values returned by a hash function are called hash values, hash codes, hash sums, or simply hashes”. And “A cryptographic hash function allows one to easily verify that some input data maps to a given hash value, but if the input data is unknown, it is deliberately difficult to reconstruct it (or equivalent alternatives) by knowing the stored hash value”. I.e. they are non-invertible or difficult, if not impossible to rebuild the input data. Again the symbols seem to rule out this being a hash. Besides, hashes are generally used to confirm the accuracy of data and not as a cipher to be decoded.
Another thing I’ve learned from this is that !! represents a double factorial (i.e. 7!! = 135*7 = 105). Interesting but probably irrelevant. (Yes I probably learned that in school at some point but I’m old so give me a break. That was a long time ago.)
There you have it. So the symbols seem to be the key here. What do you think? Do the transit maps scattered around have the key (Green – 48, Yellow – 38, Blue – 14, Red – 271)? The flashing light in the café? The blinking Ovda Regio sign?
UPDATE:
Edit 1 - Based on a Tweet from Derek brought up by FeuFighter, I went back and double checked the string. It looks like I was missing a couple of spaces in the string between the 5 and the , and also between the i and the 7. I've updated the string above to reflect the extra spaces and added two more to the frequency analysis numbers.
submitted by Quicr to raidsecrets [link] [comments]

is there a built-in to get the one line summery?

For example:
>>> help('modules uu') Here is a list of matching modules. Enter any module name to get more help. encodings.uu_codec - Python 'uu_codec' Codec - UU content transfer encoding uu - Implementation of the UUencode and UUdecode functions. uuid - UUID objects (universally unique identifiers) according to RFC 4122. 
help('modules uu') searches through all the one line descriptions of installed packages and prints the name and one line summery of everything that matches.
What I want is to look up just the package that has an exact match, and print that. I could write something to parse the output of help('modules uu') but there ought to be something built in.
Not to get all meta on everyone but help('help') isn't helping.
submitted by RhodiumHunter to learnpython [link] [comments]

[Easy] Uuencoding

You are trapped at uninhabited island only with your laptop. Still you don't want your significant other to worry about you, so you are going to send a message in a bottle with your picture or at least a couple of words from you (sure, you could just write down the words, but that would be less fun). You're going to use uuencoding for that.
Uuencoding is a form of binary-to-text encoding, which uses only symbols from 32-95 diapason, which means all symbols used in the encoding are printable.

Description of encoding

A uuencoded file starts with a header line of the form:
begin   
is the file's Unix file permissions as three octal digits (e.g. 644, 744). For Windows 644 is always used.
is the file name to be used when recreating the binary data.
signifies a newline character, used to terminate each line.
Each data line uses the format:
 
is a character indicating the number of data bytes which have been encoded on that line. This is an ASCII character determined by adding 32 to the actual byte count, with the sole exception of a grave accent "`" (ASCII code 96) signifying zero bytes. All data lines except the last (if the data was not divisible by 45), have 45 bytes of encoded data (60 characters after encoding). Therefore, the vast majority of length values is 'M', (32 + 45 = ASCII code 77 or "M").
are encoded characters.
The mechanism of uuencoding repeats the following for every 3 bytes (if there are less than 3 bytes left, trailing 0 are added):
  1. Start with 3 bytes from the source, 24 bits in total.
  2. Split into 4 6-bit groupings, each representing a value in the range 0 to 63: bits (00-05), (06-11), (12-17) and (18-23).
  3. Add 32 to each of the values. With the addition of 32 this means that the possible results can be between 32 (" " space) and 95 ("_" underline). 96 ("`" grave accent) as the "special character" is a logical extension of this range.
  4. Output the ASCII equivalent of these numbers.
For example, we want to encode a word "Cat". ASCII values for C,a,t are 67,97,116, or 010000110110000101110100 in binary. After dividing into four groups, we get 010000 110110 000101 110100, which is 16,54,5,52 in decimal. Adding 32 to this values and encoding back in ASCII, the final result is 0V%T.
The file ends with two lines:
` end 

Formal Inputs & Outputs

Input

a byte array or string.

Output

a string containing uuencoded input.

Examples

Input: Cat
Output:
begin 644 cat.txt #0V%T ` end 
Input: I feel very strongly about you doing duty. Would you give me a little more documentation about your reading in French? I am glad you are happy — but I never believe much in happiness. I never believe in misery either. Those are things you see on the stage or the screen or the printed pages, they never really happen to you in life.
Output:
begin 644 file.txt M22!F965L('9E6]U(&1O:6YG(&1U='DN(%=O M=6QD('EO=2!G:79E(&UE([email protected];&ET=&QE(&UO2!N979E 

Bonuses

Bonus 1

Write uudecoder, which decodes uuencoded input back to a byte array or string

Bonus 2

Write encoder for files as well.

Bonus 3

Make encoding parallel.

Further Reading

Binary-to-text encoding on Wikipedia.
submitted by EvgeniyZh to dailyprogrammer_ideas [link] [comments]

Online Encoders and Decoders makes it simple to encode or decode data. Firstly, choose the type of encoding tool in the Tool field. Then, using the Input type field, choose whether you want to use a text string as an input or a file. Type your input to the Text string field or select the input file through the File field and finally, hit the "Encode!" or the "Decode!" Free online utilities; Subnet Calc - compute network subnet (dotted decimal or CIDR notation) mask for IP address or range, or vice versa. Determine number of hosts, broadcast address and host class. Featured online utilities; Hash & CRC - compute a wide range of checksums / hashes / message digests for any given text or an uploaded file.; Online utilities category provides free access to most ... What is Uudecode? The program uudecode reverses the effect of uuencode, recreating the original binary file exactly. uuencode/decode became popular for sending binary files by e-mail and posting to usenet newsgroups, etc. Decode from or Encode to URL encoded (also known as Percent-encoded) format with advanced options. Enter our site for an easy-to-use online tool. Decode the text with the help of Uudecode decoder with no hassle. Simply enter the text to be decoded and click on Decode it button to decode your text from Uuencode to Uudecode for free. Free online Uudecode decoder. Generate decoded text online using Uudecode decoder.

[index] [5312] [65] [6984] [7743] [449] [2866] [4531] [1251] [1857] [1764]

https://forex-portugal.usabinaryoptions.store