From unknown Sat Aug 16 16:02:04 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#38299 <38299@debbugs.gnu.org> To: bug#38299 <38299@debbugs.gnu.org> Subject: Status: A bug while trying to decode a non encode base64 Reply-To: bug#38299 <38299@debbugs.gnu.org> Date: Sat, 16 Aug 2025 23:02:04 +0000 retitle 38299 A bug while trying to decode a non encode base64 reassign 38299 coreutils submitter 38299 vardhaman narasagoudar severity 38299 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 20 08:24:16 2019 Received: (at submit) by debbugs.gnu.org; 20 Nov 2019 13:24:16 +0000 Received: from localhost ([127.0.0.1]:49112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXPxv-0006fa-76 for submit@debbugs.gnu.org; Wed, 20 Nov 2019 08:24:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:41593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXNys-0007rU-2s for submit@debbugs.gnu.org; Wed, 20 Nov 2019 06:17:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXNyq-0006gb-5A for bug-coreutils@gnu.org; Wed, 20 Nov 2019 06:17:05 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXNyn-0006Y0-An for bug-coreutils@gnu.org; Wed, 20 Nov 2019 06:17:02 -0500 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:41185) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iXNyk-0006T9-F9 for bug-coreutils@gnu.org; Wed, 20 Nov 2019 06:16:59 -0500 Received: by mail-io1-xd36.google.com with SMTP id r144so27146084iod.8 for ; Wed, 20 Nov 2019 03:16:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=PEEoAfRnhfChKbvBNmtvvGcrKoMEYuyKK/bzKNt0P4M=; b=I2wZdQRfIR3wkpiY7xFgkot+CimOtrpCQXU6XVCn5qLTtfxH7937cFwWuzyxl8Za08 qGxaJsJQp7KbIYduG41xx1fwuSTE4Qv8lYAL6/WYE6LZd6Hw9BbAVK6su9E8fJx/KZnw SkJnARs5moiF9lqk0Mk6fCMhRMrOiDiHEcj3aBUVeFtVh/D3NNGluQdLzwmReI2zfFep +zjbwFSWrdsrZbuK6gk+IVtBtiEDTi24RNtsRJbpSvbz2M2rd6/h8QwyuGp8Ex6I7YvL zngUlxoSwBmXCPV9EignnUdxelpVITOtLOlFdVaIZU/fB5M42ZF37F97/I21k2YdeAdT WdXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=PEEoAfRnhfChKbvBNmtvvGcrKoMEYuyKK/bzKNt0P4M=; b=Nz77JUpD9tGyWAFRZsfsLk2jRTa5mh0tBjhVVyR7xU6j4YFhO0hpTEAL8xqU15LS1n gkbbitJZvdDuEJ057ShDDJO8PXYpN0q7K/Iv3BFX4Cv2o/Jtg3dhkf5+GxXWm5jCdAou 5T3CYfpMqpCIWH4GbwL0HuTVrwwLTUIet4GHNo1KMKvmB4z0XdS3zpAszqCiTB1HXTzF QxebeB4/Pkhvmfga4WnXAfKbQ/aG2z1OMboPs+/tSfak4+C7fcGefMef8axkIBK24/4m D+bwBzglJM2vfl+Ioh6hddvE7JfhczASIJEAt1tprPykwBR0FqagIq0zByDjoJTIfkuk iz4A== X-Gm-Message-State: APjAAAXk/s50q2Lxge1+VvSnoE05TbfwfED9BEiY/ghD05yysJmhF7lk 79GNXr+YXc4H5Do7TARw1rakj0wGGfndbD3bantptJ3Y X-Google-Smtp-Source: APXvYqzdx99vnL8agAd35i8RPl+xczuA7VI22yue/GDkTPI7NWJpWVfViTxBzEXCbSyNlt5Yvntllz86PZI9JItpUWw= X-Received: by 2002:a5e:c241:: with SMTP id w1mr1593932iop.274.1574248616667; Wed, 20 Nov 2019 03:16:56 -0800 (PST) MIME-Version: 1.0 From: vardhaman narasagoudar Date: Wed, 20 Nov 2019 16:46:45 +0530 Message-ID: Subject: A bug while trying to decode a non encode base64 To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary="00000000000095b27e0597c55172" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d36 X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 20 Nov 2019 08:24:13 -0500 Cc: vijay.chaos@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --00000000000095b27e0597c55172 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Team, Looks like there is a bug while trying to decode a non-encode base64 for 12 characters (or multiple of 12) , the return code is always 0. e.g:- 1) When trying to decode a encoded value [vardhaman@oc6085028360 ~]$ echo 'Nzc3Nzk5Cg=3D=3D' | base64 --decode 777799 [vardhaman@oc6085028360 ~]$ echo $? 0 2) A sample when trying to decode a non-encode value [vardhaman@oc6085028360 ~]$ echo '777799' | base64 --decode =EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BDbase64: invalid input [vardhaman@oc6085028360 ~]$ echo $? 1 3) Now trying to decode a non-encoded value of 12characters [vardhaman@oc6085028360 ~]$ echo 'vardhamanbn1' | base64 --decode =EF=BF=BD=EF=BF=BD=DD=85=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD[vardh= aman@oc6085028360 ~]$ echo $? 0 The point 3 should return code as 1 , as invalid input I feel this bug is present in all version , anywhere sharing the current version where I tested vardhaman@oc6085028360 ~]$ base64 --version base64 (GNU coreutils) 8.22 Copyright (C) 2013 Free Software Foundation, Inc. --=20 Thanks & Regards Vardhaman B.N 9945840928 --00000000000095b27e0597c55172 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team,

Looks like there is a bug whil= e trying to decode a non-encode base64 for 12 characters (or multiple of 12= ) , the return code is always 0.

e.g:-=C2=A0
=

1) When trying to decode a encoded value
[var= dhaman@oc6085028360 ~]$ echo =C2=A0'Nzc3Nzk5Cg=3D=3D' | base64 --de= code
777799
[vardhaman@oc6085028360 ~]$ echo $?
0

2)=C2=A0 =C2=A0A sample when trying to decode a non-encode value=C2= =A0
[vardhaman@oc6085028360 ~]$ echo =C2=A0'777799' | bas= e64 --decode
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BDbase64: invalid input=
[vardhaman@oc6085028360 ~]$ echo $?
1


<= /div>
3) Now trying to decode a non-encoded value of 12characters
=
[vardhaman@oc6085028360 ~]$ echo =C2=A0'vardhamanbn1' | base64= --decode
=EF=BF=BD=EF=BF=BD=DD=85=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD= =EF=BF=BD[vardhaman@oc6085028360 ~]$ echo $?
0

<= div>The point 3 should return code as 1 , as=C2=A0invalid input
<= br>
I feel this bug is present in all version , anywhere sharing = the current version where I tested

vardhaman@oc608= 5028360 ~]$ base64 --version
base64 (GNU coreutils) 8.22
Copyright (C= ) 2013 Free Software Foundation, Inc.



--
Thanks & Regards
Vardhaman B.N
9945840928
--00000000000095b27e0597c55172-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 20 09:22:55 2019 Received: (at 38299) by debbugs.gnu.org; 20 Nov 2019 14:22:55 +0000 Received: from localhost ([127.0.0.1]:49214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXQsh-0008Az-Hw for submit@debbugs.gnu.org; Wed, 20 Nov 2019 09:22:55 -0500 Received: from sa.ds-gmbh.de ([51.15.128.4]:42888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXQsf-0008Ar-OA for 38299@debbugs.gnu.org; Wed, 20 Nov 2019 09:22:54 -0500 Received: from dslb-002-202-003-020.002.202.pools.vodafone-ip.de ([2.202.3.20] helo=martnix4) by sa with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iXQsd-0003So-Tw; Wed, 20 Nov 2019 14:22:51 +0000 Date: Wed, 20 Nov 2019 15:22:44 +0100 From: Martin Schulte To: 38299@debbugs.gnu.org Subject: Re: bug#38299: A bug while trying to decode a non encode base64 Message-Id: <20191120152244.fa3d02d44da531cb1d2cf8d0@schrader-schulte.de> In-Reply-To: References: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38299 Cc: vijay.chaos@gmail.com, vardhaman narasagoudar X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Vardhaman! > 3) Now trying to decode a non-encoded value of 12characters > [vardhaman@oc6085028360 ~]$ echo 'vardhamanbn1' | base64 --decode > ��݅�����[vardhaman@oc6085028360 ~]$ echo $? > 0 $ echo -n $'\275\252\335\205\251\232\235\271\365' | base64 vardhamanbn1 So, vardhamanbn1 is a valid encoding, but the decoded data is not UTF-8 and thus leads to �. Best regards, Martin From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 20 14:21:51 2019 Received: (at 38299-done) by debbugs.gnu.org; 20 Nov 2019 19:21:51 +0000 Received: from localhost ([127.0.0.1]:50917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXVXy-0007GE-MN for submit@debbugs.gnu.org; Wed, 20 Nov 2019 14:21:50 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:54000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXVXw-0007Fy-Bt for 38299-done@debbugs.gnu.org; Wed, 20 Nov 2019 14:21:49 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0780A16006F; Wed, 20 Nov 2019 11:21:41 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 91Vcr2Me5J50; Wed, 20 Nov 2019 11:21:40 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5DE761600D6; Wed, 20 Nov 2019 11:21:40 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id xOYkM8A5tYz2; Wed, 20 Nov 2019 11:21:40 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 422DD16006F; Wed, 20 Nov 2019 11:21:40 -0800 (PST) Subject: Re: bug#38299: A bug while trying to decode a non encode base64 To: Martin Schulte , 38299-done@debbugs.gnu.org References: <20191120152244.fa3d02d44da531cb1d2cf8d0@schrader-schulte.de> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <9af30f37-19e3-f8f9-a90a-cfad43dafac8@cs.ucla.edu> Date: Wed, 20 Nov 2019 11:21:39 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191120152244.fa3d02d44da531cb1d2cf8d0@schrader-schulte.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38299-done Cc: vijay.chaos@gmail.com, vardhaman narasagoudar X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 11/20/19 6:22 AM, Martin Schulte wrote: > vardhamanbn1 is a valid encoding Thanks for explaining; closing the bug report. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 21 01:34:32 2019 Received: (at 38299) by debbugs.gnu.org; 21 Nov 2019 06:34:32 +0000 Received: from localhost ([127.0.0.1]:51179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXg2y-00015v-8W for submit@debbugs.gnu.org; Thu, 21 Nov 2019 01:34:32 -0500 Received: from mail-io1-f43.google.com ([209.85.166.43]:35447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXg2v-00015e-LG for 38299@debbugs.gnu.org; Thu, 21 Nov 2019 01:34:30 -0500 Received: by mail-io1-f43.google.com with SMTP id x21so2150017ior.2 for <38299@debbugs.gnu.org>; Wed, 20 Nov 2019 22:34:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KllEAZcmmIy6t1HDmdmgWZSXZ/ivjWRSG8X3pyP4P+E=; b=QMFaXfISMAZpkOIuJuB6ig3R9HOtdQ7TIXsvZEV0go4oobeG9kud180Jlx4RNVHjvP C6QVfB1MadV0O5DHn61yEaMxy44/EXY+5nDNDOAPPv/Wp+QskSFAzi6U8dwpgS5nhtfe WPFSGCpafMzA8wVA6QtX8yK9kxPoLyetl7zG2T2CMlNCLIL89LbgIiYVtuYAe7e8Cso1 BYVlEaGw+50zOOR7v9iTOHheBrvqAD6Bb0YKMV8v+tl5wU4KFa35I/uyDnvqAW49Xb2/ sPHRQOhpj06ZypsNLsgIGW6QA5h5fygIFnvc3k00RPErXsX1NPn7NRtZB1Y5jvsu0Hgh RJpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KllEAZcmmIy6t1HDmdmgWZSXZ/ivjWRSG8X3pyP4P+E=; b=CAMnvy6q6NKSF7OS1RFGqZJkkoo3UTuulIw2xcWGaNVaNgUVHVY56oOkeEPuHls2WA 0KAab50bep/Upz6gNOu9gydCP45by/AOnZ19sCuMebvrb8pznTdSYRTx8+FRgtSWW8hX +isuEFuQBjdCx8xNvzVITWR7o/XwLW/qOpNwN+avEYT/fgYIaN4UBrZqYNLCEHvJIt/z st16nEGhTm/ii5id61zfy8/OOfqLE+SLHBIRrz/ewdtqbR0M6k+51EzGVc4Zmg5BWFXi FmxkW2b9iPPYOIrmrJRsJuORJrDd4I7IjIMfKj7DnWM0j+QRH1T51QPo9PSiTgYTkGkf Fb/Q== X-Gm-Message-State: APjAAAV2D8SbaV6ixe8iceXZbP40O2W2RK5DL2Oi+13JZT2B3H9hWtXN q/Woja0Z6d0NuueTvueHXhu1H0g6hCF7OWxGJxMJbBVm X-Google-Smtp-Source: APXvYqwX/Yak0vycKaqarnVhQCuapic+CV8aAO2NSFLSv3aaZzI/3tW4fXiLoxStMS5E8+byxGG6O1RiI7X15xMGPMk= X-Received: by 2002:a05:6638:91:: with SMTP id v17mr2008903jao.97.1574318063426; Wed, 20 Nov 2019 22:34:23 -0800 (PST) MIME-Version: 1.0 References: <20191120152244.fa3d02d44da531cb1d2cf8d0@schrader-schulte.de> <9af30f37-19e3-f8f9-a90a-cfad43dafac8@cs.ucla.edu> In-Reply-To: <9af30f37-19e3-f8f9-a90a-cfad43dafac8@cs.ucla.edu> From: vardhaman narasagoudar Date: Thu, 21 Nov 2019 12:04:11 +0530 Message-ID: Subject: Re: bug#38299: A bug while trying to decode a non encode base64 To: 38299@debbugs.gnu.org Content-Type: multipart/alternative; boundary="000000000000ef22500597d57c8c" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38299 Cc: vijay.chaos@gmail.com, Martin Schulte , Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000ef22500597d57c8c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Team, Thanks for replying the query, but if I check online ( https://www.base64decode.org/) for decoding the same in online . I get an error message (which is valid) e.g:- 1) if I try to decode "777799" I get an error message "No printable characters found, try another source charset, or upload your data as a file for binary decoding." Similarly we got return code as 1 "invalid input" in the terminal. 2) Now if I try to decode "vardhamanbn1" I get the error message (any 12 characters or multiple of 12 characters which is a non-encoded value, if try to decode) "No printable characters found, try another source charset, or upload your data as a file for binary decoding." But when we try the same in terminal , we get the return code as 0 the symbol as per inputs given "UTF-8 and thus leads to =EF=BF=BD." Now as a work around we are using a) [vardhaman@oc6085028360 ~]$ echo -n "vardhamanbn1" | base64 -d | iconv -f utf8 iconv: illegal input sequence at position 0 also we tried on another sample b) [vardhaman@oc6085028360 ~]$ echo -n '777799' | base64 -d | iconv -f utf= 8 base64: invalid input iconv: illegal input sequence at position 0 without using "iconv -f utf8" [vardhaman@oc6085028360 ~]$ echo -n '777799' | base64 -d =EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BDbase64: invalid input So we feel its something still with 12 & multiple of 12 characters leading to the issue, when we try to decode a non-decode value. Or should we think characters of multiple of 12 will be treated as a base64 format e.g when I tried decoding 24 non-encode character:- [vardhaman@oc6085028360 ~]$ echo -n 'vardhamanbn1vardhamanbn1' | base64 --decode =EF=BF=BD=EF=BF=BD=DD=85=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF= =BD=EF=BF=BD=DD=85=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD[vardhaman@o= c6085028360 ~]$ echo $? 0 On Thu, Nov 21, 2019 at 12:51 AM Paul Eggert wrote: > On 11/20/19 6:22 AM, Martin Schulte wrote: > > vardhamanbn1 is a valid encoding > > Thanks for explaining; closing the bug report. > --=20 Thanks & Regards Vardhaman B.N --000000000000ef22500597d57c8c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team,

Thanks for re= plying the query, but if I check online=C2=A0(https://www.base64decode.org/)=C2=A0for decoding=C2=A0 the= same in online .=C2=A0

I get=C2=A0 an error=C2=A0= message (which is valid) e.g:-

1) if I try to dec= ode "777799"=C2=A0 I get an error=C2=A0message

"No printable characters found, try another source charset, or = upload your data as a file for binary decoding."

Similarly we got return code as 1 "invalid input" in the = terminal.

2) Now if I try to decode "vardhama= nbn1" I get the error message=C2=A0 (any 12 characters or multiple of = 12 characters which is a non-encoded value, if try to decode)
&qu= ot;No printable characters found, try another source charset, or upload you= r data as a file for binary decoding."

But wh= en we try the same in terminal , we get the return code as 0 the symbol as = per inputs given
=C2=A0"UTF-8 and thus leads to =EF=BF=BD.&q= uot;

Now as a work around we are using=C2=A0
=
a) [vardhaman@oc6085028360 ~]$ echo -n "vardhamanbn1" | base= 64 -d | iconv -f utf8
iconv: illegal input sequence at position 0

also we tried on another sample=C2=A0

=
b) [vardhaman@oc6085028360 ~]$ echo =C2=A0-n '777799' | = base64 -d | iconv -f utf8
base64: invalid input
iconv: illegal input = sequence at position 0

without using "ico= nv -f utf8"

[vardhaman@oc6085028360 ~]$ =C2= =A0echo =C2=A0-n '777799' | base64 -d
=EF=BF=BD=EF=BF=BD=EF=BF= =BD=EF=BF=BDbase64: invalid input


So we feel its something still with 12 & multiple of 12 characters l= eading to the issue, when we try to decode a non-decode value.
Or= should we think characters of multiple of 12 will be treated as a base64 f= ormat

=C2=A0e.g when I tried decoding 24 non-encod= e character:-
=C2=A0[vardhaman@oc6085028360 ~]$ echo -n 'vard= hamanbn1vardhamanbn1' | base64 --decode
=EF=BF=BD=EF=BF=BD=DD=85= =EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=DD=85=EF=BF= =BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD[vardhaman@oc6085028360 ~]$ echo $?<= br>0



=
On Thu, Nov 21, 2019 at 12:51 AM Paul= Eggert <eggert@cs.ucla.edu>= ; wrote:
On 11/2= 0/19 6:22 AM, Martin Schulte wrote:
> vardhamanbn1 is a valid encoding

Thanks for explaining; closing the bug report.


--
Thanks & Regards
Vardhaman B.N
<= /div> --000000000000ef22500597d57c8c-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 21 03:13:07 2019 Received: (at 38299) by debbugs.gnu.org; 21 Nov 2019 08:13:07 +0000 Received: from localhost ([127.0.0.1]:51200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXhaN-0005Zw-3r for submit@debbugs.gnu.org; Thu, 21 Nov 2019 03:13:07 -0500 Received: from mailgw1.uni-kl.de ([131.246.120.220]:52296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXha9-0005ZK-3y for 38299@debbugs.gnu.org; Thu, 21 Nov 2019 03:13:06 -0500 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id xAL8CejS070203 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Nov 2019 09:12:40 +0100 Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1]) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id xAL8CeF4019901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 21 Nov 2019 09:12:40 +0100 Received: (from auerswal@localhost) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id xAL8Cd3F019900; Thu, 21 Nov 2019 09:12:39 +0100 Date: Thu, 21 Nov 2019 09:12:39 +0100 From: Erik Auerswald To: vardhaman narasagoudar Subject: Re: bug#38299: A bug while trying to decode a non encode base64 Message-ID: <20191121081239.GA18594@unix-ag.uni-kl.de> References: <20191120152244.fa3d02d44da531cb1d2cf8d0@schrader-schulte.de> <9af30f37-19e3-f8f9-a90a-cfad43dafac8@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, hits=-1, tests=ALL_TRUSTED=-1 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38299 Cc: 38299@debbugs.gnu.org, vijay.chaos@gmail.com, Martin Schulte , Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, On Thu, Nov 21, 2019 at 12:04:11PM +0530, vardhaman narasagoudar wrote: > On Thu, Nov 21, 2019 at 12:51 AM Paul Eggert wrote: > > On 11/20/19 6:22 AM, Martin Schulte wrote: > > > vardhamanbn1 is a valid encoding > > > > Thanks for explaining; closing the bug report. > > Thanks for replying the query, but if I check online ( > https://www.base64decode.org/) for decoding the same in online . > > I get an error message (which is valid) e.g:- > > 1) if I try to decode "777799" I get an error message > > "No printable characters found, try another source charset, or upload your > data as a file for binary decoding." The error message says that the decoded data is not printable. It does not say anything about invalid input data, although the input data is not correctly Base64 encoded. > Similarly we got return code as 1 "invalid input" in the terminal. > > 2) Now if I try to decode "vardhamanbn1" I get the error message (any 12 > characters or multiple of 12 characters which is a non-encoded value, if > try to decode) > "No printable characters found, try another source charset, or upload your > data as a file for binary decoding." You get the same error message about the decoded data. This is correct. The site even tells you that the interface you use does not support binary, i.e., non-printable data. > But when we try the same in terminal , we get the return code as 0 the > symbol as per inputs given > "UTF-8 and thus leads to �." > > Now as a work around we are using That is not a workaround, but the necessary check for valid output data for your application, since you seem to require a Base64 encoding of UTF-8 data. > a) [vardhaman@oc6085028360 ~]$ echo -n "vardhamanbn1" | base64 -d | iconv > -f utf8 > iconv: illegal input sequence at position 0 Base64 can encode any binary data, not just valid UTF-8 text. > also we tried on another sample > > b) [vardhaman@oc6085028360 ~]$ echo -n '777799' | base64 -d | iconv -f utf8 > base64: invalid input > iconv: illegal input sequence at position 0 > > without using "iconv -f utf8" > > [vardhaman@oc6085028360 ~]$ echo -n '777799' | base64 -d > ����base64: invalid input > > > So we feel its something still with 12 & multiple of 12 characters leading > to the issue, when we try to decode a non-decode value. The magic number is actually 4, because each symbol in a base64 encoded string represents 6 bits, thus 4 symbols give you 3 bytes of encoded data. Any combination of Base64 symbols that forms a string of a length divisibale by 4 is a valid Base64 encoding. This does not give any guarantee about the data. > Or should we think characters of multiple of 12 will be treated as a base64 > format Yes. Actually, any multiple of 4 characters. > e.g when I tried decoding 24 non-encode character:- > [vardhaman@oc6085028360 ~]$ echo -n 'vardhamanbn1vardhamanbn1' | base64 > --decode > ��݅�������݅�����[vardhaman@oc6085028360 ~]$ echo $? > 0 Thanks, Erik -- The laws of mathematics are very commendable, but the only law that applies in Australia is the law of Australia. -- Australian Prime Minister Malcolm Turnbull From unknown Sat Aug 16 16:02:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 19 Dec 2019 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator