in Computer Networks edited by
10,130 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}$
in Computer Networks edited by
10.1k views

4 Comments

is it in cse syllabus 2017?
1
1
Is it? any information?
1
1
MIME protocol is not mentioned in the list of Application layer protocol in the Gate portion.
0
0
Not in syllabus from 2021
1
1

3 Answers

38 votes
38 votes
Best answer

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

4 Comments

@Bikram sir, so even if it were base 16 rather than 64, then also padding will be done at RHS? Do we pad always at RHS when performing encoding since we will never know the size of data?

0
0
I think what you are saying is we have to consider the situation when computer is sending bits one by one and we have no idea what will be the size of data so we will append at end, am I correct? and then what was that case when we were appending 0's on LHS while converting binary to hexadecimal?
0
0
@ayush.5

https://gateoverflow.in/3515/gate2007-it-70?show=144761#c144761

so even if it were base 16 rather than 64, then also padding will be done at RHS...

https://gateoverflow.in/3515/gate2007-it-70?show=151195#c151195
0
0
19 votes
19 votes
Base64

Answer (B)

string = czfpqw

sub string =  fpq

4 Comments

@jayesh..kindly elaborate your solution, it is not clear to me
0
0
@Manish,kindly elaborate your solution
0
0
True ...Instead of c have a o ...may be he misstype.
0
0
1 vote
1 vote
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".
by
Answer:

Related questions