10,130 views

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}$

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

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'

by

@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?

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?
@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

string = czfpqw

sub string =  fpq

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