edited by
12,041 views
28 votes
28 votes

You are given the following four bytes : $$\begin{array}{| c | c |  c | c |}  \hline 10100011 & 00110111 & 11101001 & 10101011    \\\hline  \end{array}$$ Which of the following are substrings of the base $64$ encoding of the above four bytes?

  1. $\text{zdp}$
  2. $\text{fpq}$
  3. $\text{qwA}$
  4. $\text{oze}$
edited by

3 Answers

Best answer
38 votes
38 votes

Your are given the following four bytes :

$10100011\qquad 00110111\qquad 11101001\qquad 10101011 =32 +\text{ADD 4 0's}=36$
According to Wikipedia, groups of $6$ bits should be made. https://en.wikipedia.org/wiki/Base64

$101000\qquad 110011\qquad 011111\qquad 101001\qquad 101010\qquad 11\mathbf{0000}$

$\begin{array} {c c c c c c c} 40 & 51 & 31 & 41 & 42 & 48 & \\ o & z & f & p & q & w & \text{from base -64 table} \end{array}$

Now, the longest substring will be from option checking  is 'fpq'

Correct Answer: B.

edited by
19 votes
19 votes
Base64

Answer (B)

string = czfpqw

sub string =  fpq

1 votes
1 votes
As it is asking substring of the base 64 and the given numbers are binary, so we need to make it pair of 6,

Because 2^6=64,

So the pairs will be 101000 | 110011 | 011111 | 101001 | 101010 | 11

The last number has only 2 bits so we will use padding so it'll be 110000

So they will be 40 51 31 41  42 and 48

Which is equals to o z f p q w ( see the base table of 64)

so the substring is "fpq".
Answer:

Related questions