Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

news: gotcha


computers / comp.sys.tandem / Re: SHA-256 Hash Alogrithm

SubjectAuthor
* Re: SHA-256 Hash AlogrithmAravind Aravind
`* Re: SHA-256 Hash AlogrithmRandall
 `* Re: SHA-256 Hash Alogrithmchris...@fullgera.se
  `* Re: SHA-256 Hash AlogrithmRandall
   `* Re: SHA-256 Hash Alogrithmj-ma...@pacbell.net
    `- Re: SHA-256 Hash AlogrithmRandall

1
Re: SHA-256 Hash Alogrithm

<ccf44430-e7c8-4461-b196-1cbe5e231954n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=560&group=comp.sys.tandem#560

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:6214:4014:b0:4b3:eff6:d9b with SMTP id kd20-20020a056214401400b004b3eff60d9bmr13815736qvb.20.1665559682751;
Wed, 12 Oct 2022 00:28:02 -0700 (PDT)
X-Received: by 2002:a81:c30a:0:b0:328:4a6c:bc89 with SMTP id
r10-20020a81c30a000000b003284a6cbc89mr24816034ywk.29.1665559682478; Wed, 12
Oct 2022 00:28:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Wed, 12 Oct 2022 00:28:02 -0700 (PDT)
In-Reply-To: <76aac903-d474-45f2-b1d7-c9f47516ee9fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2405:201:e032:1064:bc92:d28:fbf4:74eb;
posting-account=w42JRwoAAADP6uiAkNXtJTq-H0VER44r
NNTP-Posting-Host: 2405:201:e032:1064:bc92:d28:fbf4:74eb
References: <f173c0d0-aa1c-43ae-b816-906ed474d7c1n@googlegroups.com> <76aac903-d474-45f2-b1d7-c9f47516ee9fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ccf44430-e7c8-4461-b196-1cbe5e231954n@googlegroups.com>
Subject: Re: SHA-256 Hash Alogrithm
From: aravindf...@gmail.com (Aravind Aravind)
Injection-Date: Wed, 12 Oct 2022 07:28:02 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 132
 by: Aravind Aravind - Wed, 12 Oct 2022 07:28 UTC

On Wednesday, February 24, 2021 at 10:59:44 AM UTC+5:30, s4n...@gmail.com wrote:
> On Saturday, February 13, 2021 at 4:21:56 AM UTC+8, ssrin...@gmail.com wrote:
> > Hi,
> >
> > I am having a ".TXT" file and I have generated SHA hash of ".TXT" file using Windows Command prompt like below
> >
> > C:\temp>certutil -hashfile test.txt sha256
> > SHA256 hash of test.txt:
> > 7d967bad44f719f3733bbec0f1228f0247794096a434d57e6875f3367ead5f33
> > CertUtil: -hashfile command completed successfully.
> > =============================================================
> > Now, If I upload the same ".TXT" file to Tandem . How to generate a SHA256 key so that I can compare the key generated from Tandem to the key which I already generated using Windows Command prompt (Certutil)
> > I am planning to use COBOL programming. Is there any routine which we can call from cobol ?
> > any help would be appreciated.
> I was created SHA3-512 using Java and run under pathway server:
>
> .properties
> -----------------
>
> # Type for algorithm
> # sha3-224
> # sha3-256
> # sha3-384
> # sha3-512
> sha3.algorithm=sha3-512
> sha3.uppercase=N
> sha3.cutover=2200
> sha3.trace=off
> ---------------------------------------------------------------------------------------
>
>
> protected String calculateSHA3( String filename, EnscribeFile ef ) {
>
> I_Data iData = new I_Data();
> Sha3 sha3 = null;
> EnscribeOpenOptions opt = new EnscribeOpenOptions();
> String result = null;
> StringBuilder sb = new StringBuilder();
> String lf = "";
> String cr = "";
>
> if (MyProperties.isTrace()) {
> logger.info(String.format("Trace on: Filename: %s", filename));
> }
>
> switch (MyProperties.getAlgorithm().toUpperCase()) {
> case "SHA3-224":
> sha3 = new Sha3(Type.SHA3_224);
> break;
> case "SHA3-256":
> sha3 = new Sha3(Type.SHA3_256);
> break;
> case "SHA3-384":
> sha3 = new Sha3(Type.SHA3_384);
> break;
> case "SHA3-512":
> sha3 = new Sha3(Type.SHA3_512);
> break;
> default:
> sha3 = new Sha3(Type.SHA3_512);
> break;
> }
>
> opt.setAccess(EnscribeOpenOptions.READ_ONLY);
> opt.setExclusion(EnscribeOpenOptions.SHARED);
>
> try {
> ef.open( opt );
>
> if ( ef.getFileInfo().getFileType() != 0) {
> if (MyProperties.isCrChar())
> {
> cr = "\r";
> }
>
> iData.set_bufferLen(ef.getFileInfo().getRecordLength());
> lf = "\n";
> }
> else
> {
> /*
> * For unstructured data, we need to use buffer as 1024 bytes to read the data
> */
> opt.setUnstructuredAccess(true);
> opt.setSequentialBlockBufferLength(1024);
> }
>
> int countread = 0;
> do {
> try {
> countread = ef.read(iData);
> if ( countread != -1 ) {
> sb.append(iData.getSdata());
> sb.append(cr).append(lf);
> }
> } catch (DataConversionException e) {
> // TODO Auto-generated catch block
> logger.log(Level.SEVERE, "Filename: " +
> ef.getFileName() + ". " +
> e.getLocalizedMessage(), e);
> }
>
> } while (countread != -1);
>
> /*
> * Compute SHA3
> */
>
> result = HexTools.convertToHex(sha3.encode(
> sb.toString().getBytes(StandardCharsets.UTF_8)));
>
> if (MyProperties.isUppercase())
> {
> result = result.toUpperCase();
> }
> else
> {
> result = result.toLowerCase();
> }
> } catch (EnscribeFileException e) {
> // TODO Auto-generated catch block
> logger.log(Level.SEVERE, "Filename: " +
> ef.getFileName() + ". " +
> e.getLocalizedMessage(), e);
> } finally {
> ef.close();
> sb.setLength(0);
> }
>
> return result;
>
> }
Could anybody help on this ? i want to generate hash from file using SHA3-256 algorithm in vb.net, pls anybody help to get sample code or any idea on this.

Re: SHA-256 Hash Alogrithm

<1d87f3cd-7214-4725-9115-c79298beb018n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=561&group=comp.sys.tandem#561

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:620a:1a04:b0:6ee:93fc:b44f with SMTP id bk4-20020a05620a1a0400b006ee93fcb44fmr3513750qkb.756.1665590981193;
Wed, 12 Oct 2022 09:09:41 -0700 (PDT)
X-Received: by 2002:a81:6dcd:0:b0:35c:9df4:8d6 with SMTP id
i196-20020a816dcd000000b0035c9df408d6mr27434118ywc.266.1665590980955; Wed, 12
Oct 2022 09:09:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Wed, 12 Oct 2022 09:09:40 -0700 (PDT)
In-Reply-To: <ccf44430-e7c8-4461-b196-1cbe5e231954n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:3fa6:b400:3d07:7cb:fd8a:435;
posting-account=6VebZwoAAAAgrpUtsowyjrKRLNlqxnXo
NNTP-Posting-Host: 2607:fea8:3fa6:b400:3d07:7cb:fd8a:435
References: <f173c0d0-aa1c-43ae-b816-906ed474d7c1n@googlegroups.com>
<76aac903-d474-45f2-b1d7-c9f47516ee9fn@googlegroups.com> <ccf44430-e7c8-4461-b196-1cbe5e231954n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1d87f3cd-7214-4725-9115-c79298beb018n@googlegroups.com>
Subject: Re: SHA-256 Hash Alogrithm
From: rsbec...@nexbridge.com (Randall)
Injection-Date: Wed, 12 Oct 2022 16:09:41 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6216
 by: Randall - Wed, 12 Oct 2022 16:09 UTC

On Wednesday, October 12, 2022 at 3:28:03 a.m. UTC-4, aravind...@gmail.com wrote:
> On Wednesday, February 24, 2021 at 10:59:44 AM UTC+5:30, s4n...@gmail.com wrote:
> > On Saturday, February 13, 2021 at 4:21:56 AM UTC+8, ssrin...@gmail.com wrote:
> > > Hi,
> > >
> > > I am having a ".TXT" file and I have generated SHA hash of ".TXT" file using Windows Command prompt like below
> > >
> > > C:\temp>certutil -hashfile test.txt sha256
> > > SHA256 hash of test.txt:
> > > 7d967bad44f719f3733bbec0f1228f0247794096a434d57e6875f3367ead5f33
> > > CertUtil: -hashfile command completed successfully.
> > > =============================================================
> > > Now, If I upload the same ".TXT" file to Tandem . How to generate a SHA256 key so that I can compare the key generated from Tandem to the key which I already generated using Windows Command prompt (Certutil)
> > > I am planning to use COBOL programming. Is there any routine which we can call from cobol ?
> > > any help would be appreciated.
> > I was created SHA3-512 using Java and run under pathway server:
> >
> > .properties
> > -----------------
> >
> > # Type for algorithm
> > # sha3-224
> > # sha3-256
> > # sha3-384
> > # sha3-512
> > sha3.algorithm=sha3-512
> > sha3.uppercase=N
> > sha3.cutover=2200
> > sha3.trace=off
> > ---------------------------------------------------------------------------------------
> >
> >
> > protected String calculateSHA3( String filename, EnscribeFile ef ) {
> >
> > I_Data iData = new I_Data();
> > Sha3 sha3 = null;
> > EnscribeOpenOptions opt = new EnscribeOpenOptions();
> > String result = null;
> > StringBuilder sb = new StringBuilder();
> > String lf = "";
> > String cr = "";
> >
> > if (MyProperties.isTrace()) {
> > logger.info(String.format("Trace on: Filename: %s", filename));
> > }
> >
> > switch (MyProperties.getAlgorithm().toUpperCase()) {
> > case "SHA3-224":
> > sha3 = new Sha3(Type.SHA3_224);
> > break;
> > case "SHA3-256":
> > sha3 = new Sha3(Type.SHA3_256);
> > break;
> > case "SHA3-384":
> > sha3 = new Sha3(Type.SHA3_384);
> > break;
> > case "SHA3-512":
> > sha3 = new Sha3(Type.SHA3_512);
> > break;
> > default:
> > sha3 = new Sha3(Type.SHA3_512);
> > break;
> > }
> >
> > opt.setAccess(EnscribeOpenOptions.READ_ONLY);
> > opt.setExclusion(EnscribeOpenOptions.SHARED);
> >
> > try {
> > ef.open( opt );
> >
> > if ( ef.getFileInfo().getFileType() != 0) {
> > if (MyProperties.isCrChar())
> > {
> > cr = "\r";
> > }
> >
> > iData.set_bufferLen(ef.getFileInfo().getRecordLength());
> > lf = "\n";
> > }
> > else
> > {
> > /*
> > * For unstructured data, we need to use buffer as 1024 bytes to read the data
> > */
> > opt.setUnstructuredAccess(true);
> > opt.setSequentialBlockBufferLength(1024);
> > }
> >
> > int countread = 0;
> > do {
> > try {
> > countread = ef.read(iData);
> > if ( countread != -1 ) {
> > sb.append(iData.getSdata());
> > sb.append(cr).append(lf);
> > }
> > } catch (DataConversionException e) {
> > // TODO Auto-generated catch block
> > logger.log(Level.SEVERE, "Filename: " +
> > ef.getFileName() + ". " +
> > e.getLocalizedMessage(), e);
> > }
> >
> > } while (countread != -1);
> >
> > /*
> > * Compute SHA3
> > */
> >
> > result = HexTools.convertToHex(sha3.encode(
> > sb.toString().getBytes(StandardCharsets.UTF_8)));
> >
> > if (MyProperties.isUppercase())
> > {
> > result = result.toUpperCase();
> > }
> > else
> > {
> > result = result.toLowerCase();
> > }
> > } catch (EnscribeFileException e) {
> > // TODO Auto-generated catch block
> > logger.log(Level.SEVERE, "Filename: " +
> > ef.getFileName() + ". " +
> > e.getLocalizedMessage(), e);
> > } finally {
> > ef.close();
> > sb.setLength(0);
> > }
> >
> > return result;
> >
> > }
> Could anybody help on this ? i want to generate hash from file using SHA3-256 algorithm in vb.net, pls anybody help to get sample code or any idea on this.

Googling this, you could potentially use https://github.com/brainhub/SHA3IUF or some other Open Source library, but that assumes your organization can take and use code from GitHub. Or develop your own SHA3 code - it is not that hard to do and well documented.

Re: SHA-256 Hash Alogrithm

<94e49b01-56e0-4d3f-94a1-46f399643c86n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=562&group=comp.sys.tandem#562

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a37:a996:0:b0:6ec:59da:a72 with SMTP id s144-20020a37a996000000b006ec59da0a72mr14999324qke.676.1665655028244;
Thu, 13 Oct 2022 02:57:08 -0700 (PDT)
X-Received: by 2002:a0d:d90b:0:b0:358:1fa:78f1 with SMTP id
b11-20020a0dd90b000000b0035801fa78f1mr30324593ywe.449.1665655027936; Thu, 13
Oct 2022 02:57:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Thu, 13 Oct 2022 02:57:07 -0700 (PDT)
In-Reply-To: <1d87f3cd-7214-4725-9115-c79298beb018n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=178.174.132.63; posting-account=AF4aEwoAAAAItehH-CV0swMxwnHAPQnK
NNTP-Posting-Host: 178.174.132.63
References: <f173c0d0-aa1c-43ae-b816-906ed474d7c1n@googlegroups.com>
<76aac903-d474-45f2-b1d7-c9f47516ee9fn@googlegroups.com> <ccf44430-e7c8-4461-b196-1cbe5e231954n@googlegroups.com>
<1d87f3cd-7214-4725-9115-c79298beb018n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <94e49b01-56e0-4d3f-94a1-46f399643c86n@googlegroups.com>
Subject: Re: SHA-256 Hash Alogrithm
From: christof...@fullgera.se (chris...@fullgera.se)
Injection-Date: Thu, 13 Oct 2022 09:57:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: chris...@fullgera.se - Thu, 13 Oct 2022 09:57 UTC

On Wednesday, October 12, 2022 at 6:09:42 PM UTC+2, Randall wrote:
> On Wednesday, October 12, 2022 at 3:28:03 a.m. UTC-4, aravind...@gmail.com wrote:
> > On Wednesday, February 24, 2021 at 10:59:44 AM UTC+5:30, s4n...@gmail.com wrote:
> > > On Saturday, February 13, 2021 at 4:21:56 AM UTC+8, ssrin...@gmail.com wrote:
> > > > Hi,
> > > >
> > > > I am having a ".TXT" file and I have generated SHA hash of ".TXT" file using Windows Command prompt like below
> > > >
> > > > C:\temp>certutil -hashfile test.txt sha256
> > > > SHA256 hash of test.txt:
> > > > 7d967bad44f719f3733bbec0f1228f0247794096a434d57e6875f3367ead5f33
> > > > CertUtil: -hashfile command completed successfully.
> > > > =============================================================
> > > > Now, If I upload the same ".TXT" file to Tandem . How to generate a SHA256 key so that I can compare the key generated from Tandem to the key which I already generated using Windows Command prompt (Certutil)
> > > > I am planning to use COBOL programming. Is there any routine which we can call from cobol ?
> > > > any help would be appreciated.
> > > I was created SHA3-512 using Java and run under pathway server:
> > >
> > > .properties
> > > -----------------
> > >
> > > # Type for algorithm
> > > # sha3-224
> > > # sha3-256
> > > # sha3-384
> > > # sha3-512
> > > sha3.algorithm=sha3-512
> > > sha3.uppercase=N
> > > sha3.cutover=2200
> > > sha3.trace=off
> > > ---------------------------------------------------------------------------------------
> > >
> > >
> > > protected String calculateSHA3( String filename, EnscribeFile ef ) {
> > >
> > > I_Data iData = new I_Data();
> > > Sha3 sha3 = null;
> > > EnscribeOpenOptions opt = new EnscribeOpenOptions();
> > > String result = null;
> > > StringBuilder sb = new StringBuilder();
> > > String lf = "";
> > > String cr = "";
> > >
> > > if (MyProperties.isTrace()) {
> > > logger.info(String.format("Trace on: Filename: %s", filename));
> > > }
> > >
> > > switch (MyProperties.getAlgorithm().toUpperCase()) {
> > > case "SHA3-224":
> > > sha3 = new Sha3(Type.SHA3_224);
> > > break;
> > > case "SHA3-256":
> > > sha3 = new Sha3(Type.SHA3_256);
> > > break;
> > > case "SHA3-384":
> > > sha3 = new Sha3(Type.SHA3_384);
> > > break;
> > > case "SHA3-512":
> > > sha3 = new Sha3(Type.SHA3_512);
> > > break;
> > > default:
> > > sha3 = new Sha3(Type.SHA3_512);
> > > break;
> > > }
> > >
> > > opt.setAccess(EnscribeOpenOptions.READ_ONLY);
> > > opt.setExclusion(EnscribeOpenOptions.SHARED);
> > >
> > > try {
> > > ef.open( opt );
> > >
> > > if ( ef.getFileInfo().getFileType() != 0) {
> > > if (MyProperties.isCrChar())
> > > {
> > > cr = "\r";
> > > }
> > >
> > > iData.set_bufferLen(ef.getFileInfo().getRecordLength());
> > > lf = "\n";
> > > }
> > > else
> > > {
> > > /*
> > > * For unstructured data, we need to use buffer as 1024 bytes to read the data
> > > */
> > > opt.setUnstructuredAccess(true);
> > > opt.setSequentialBlockBufferLength(1024);
> > > }
> > >
> > > int countread = 0;
> > > do {
> > > try {
> > > countread = ef.read(iData);
> > > if ( countread != -1 ) {
> > > sb.append(iData.getSdata());
> > > sb.append(cr).append(lf);
> > > }
> > > } catch (DataConversionException e) {
> > > // TODO Auto-generated catch block
> > > logger.log(Level.SEVERE, "Filename: " +
> > > ef.getFileName() + ". " +
> > > e.getLocalizedMessage(), e);
> > > }
> > >
> > > } while (countread != -1);
> > >
> > > /*
> > > * Compute SHA3
> > > */
> > >
> > > result = HexTools.convertToHex(sha3.encode(
> > > sb.toString().getBytes(StandardCharsets.UTF_8)));
> > >
> > > if (MyProperties.isUppercase())
> > > {
> > > result = result.toUpperCase();
> > > }
> > > else
> > > {
> > > result = result.toLowerCase();
> > > }
> > > } catch (EnscribeFileException e) {
> > > // TODO Auto-generated catch block
> > > logger.log(Level.SEVERE, "Filename: " +
> > > ef.getFileName() + ". " +
> > > e.getLocalizedMessage(), e);
> > > } finally {
> > > ef.close();
> > > sb.setLength(0);
> > > }
> > >
> > > return result;
> > >
> > > }
> > Could anybody help on this ? i want to generate hash from file using SHA3-256 algorithm in vb.net, pls anybody help to get sample code or any idea on this.
> Googling this, you could potentially use https://github.com/brainhub/SHA3IUF or some other Open Source library, but that assumes your organization can take and use code from GitHub. Or develop your own SHA3 code - it is not that hard to do and well documented.

I'm a bit interested in this topic due to the fact that we have a MD5 implementation which we need to replace. Haven't gotten to actually do it yet but when I did some research I found a very well structured library called Nettle which has the following punch line "Nettle is a low-level cryptographic library that is designed to fit easily in more or less any context.".
You'll find it here: https://git.lysator.liu.se/nettle/nettle

Please report back if you're successful and tell us how you solved it!

Re: SHA-256 Hash Alogrithm

<d329b648-7035-4863-81d2-947f370444c5n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=566&group=comp.sys.tandem#566

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:622a:15c8:b0:39c:ea8a:82e3 with SMTP id d8-20020a05622a15c800b0039cea8a82e3mr21475869qty.146.1666465724443;
Sat, 22 Oct 2022 12:08:44 -0700 (PDT)
X-Received: by 2002:a81:a116:0:b0:36a:de9d:824c with SMTP id
y22-20020a81a116000000b0036ade9d824cmr4680183ywg.449.1666465724046; Sat, 22
Oct 2022 12:08:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Sat, 22 Oct 2022 12:08:43 -0700 (PDT)
In-Reply-To: <94e49b01-56e0-4d3f-94a1-46f399643c86n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:3fa6:b400:8044:c5af:69f7:2a4b;
posting-account=6VebZwoAAAAgrpUtsowyjrKRLNlqxnXo
NNTP-Posting-Host: 2607:fea8:3fa6:b400:8044:c5af:69f7:2a4b
References: <f173c0d0-aa1c-43ae-b816-906ed474d7c1n@googlegroups.com>
<76aac903-d474-45f2-b1d7-c9f47516ee9fn@googlegroups.com> <ccf44430-e7c8-4461-b196-1cbe5e231954n@googlegroups.com>
<1d87f3cd-7214-4725-9115-c79298beb018n@googlegroups.com> <94e49b01-56e0-4d3f-94a1-46f399643c86n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d329b648-7035-4863-81d2-947f370444c5n@googlegroups.com>
Subject: Re: SHA-256 Hash Alogrithm
From: rsbec...@nexbridge.com (Randall)
Injection-Date: Sat, 22 Oct 2022 19:08:44 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 7930
 by: Randall - Sat, 22 Oct 2022 19:08 UTC

On Thursday, October 13, 2022 at 5:57:09 a.m. UTC-4, Christoffer Lund wrote:
> On Wednesday, October 12, 2022 at 6:09:42 PM UTC+2, Randall wrote:
> > On Wednesday, October 12, 2022 at 3:28:03 a.m. UTC-4, aravind...@gmail.com wrote:
> > > On Wednesday, February 24, 2021 at 10:59:44 AM UTC+5:30, s4n...@gmail..com wrote:
> > > > On Saturday, February 13, 2021 at 4:21:56 AM UTC+8, ssrin...@gmail.com wrote:
> > > > > Hi,
> > > > >
> > > > > I am having a ".TXT" file and I have generated SHA hash of ".TXT" file using Windows Command prompt like below
> > > > >
> > > > > C:\temp>certutil -hashfile test.txt sha256
> > > > > SHA256 hash of test.txt:
> > > > > 7d967bad44f719f3733bbec0f1228f0247794096a434d57e6875f3367ead5f33
> > > > > CertUtil: -hashfile command completed successfully.
> > > > > =============================================================
> > > > > Now, If I upload the same ".TXT" file to Tandem . How to generate a SHA256 key so that I can compare the key generated from Tandem to the key which I already generated using Windows Command prompt (Certutil)
> > > > > I am planning to use COBOL programming. Is there any routine which we can call from cobol ?
> > > > > any help would be appreciated.
> > > > I was created SHA3-512 using Java and run under pathway server:
> > > >
> > > > .properties
> > > > -----------------
> > > >
> > > > # Type for algorithm
> > > > # sha3-224
> > > > # sha3-256
> > > > # sha3-384
> > > > # sha3-512
> > > > sha3.algorithm=sha3-512
> > > > sha3.uppercase=N
> > > > sha3.cutover=2200
> > > > sha3.trace=off
> > > > ---------------------------------------------------------------------------------------
> > > >
> > > >
> > > > protected String calculateSHA3( String filename, EnscribeFile ef ) {
> > > >
> > > > I_Data iData = new I_Data();
> > > > Sha3 sha3 = null;
> > > > EnscribeOpenOptions opt = new EnscribeOpenOptions();
> > > > String result = null;
> > > > StringBuilder sb = new StringBuilder();
> > > > String lf = "";
> > > > String cr = "";
> > > >
> > > > if (MyProperties.isTrace()) {
> > > > logger.info(String.format("Trace on: Filename: %s", filename));
> > > > }
> > > >
> > > > switch (MyProperties.getAlgorithm().toUpperCase()) {
> > > > case "SHA3-224":
> > > > sha3 = new Sha3(Type.SHA3_224);
> > > > break;
> > > > case "SHA3-256":
> > > > sha3 = new Sha3(Type.SHA3_256);
> > > > break;
> > > > case "SHA3-384":
> > > > sha3 = new Sha3(Type.SHA3_384);
> > > > break;
> > > > case "SHA3-512":
> > > > sha3 = new Sha3(Type.SHA3_512);
> > > > break;
> > > > default:
> > > > sha3 = new Sha3(Type.SHA3_512);
> > > > break;
> > > > }
> > > >
> > > > opt.setAccess(EnscribeOpenOptions.READ_ONLY);
> > > > opt.setExclusion(EnscribeOpenOptions.SHARED);
> > > >
> > > > try {
> > > > ef.open( opt );
> > > >
> > > > if ( ef.getFileInfo().getFileType() != 0) {
> > > > if (MyProperties.isCrChar())
> > > > {
> > > > cr = "\r";
> > > > }
> > > >
> > > > iData.set_bufferLen(ef.getFileInfo().getRecordLength());
> > > > lf = "\n";
> > > > }
> > > > else
> > > > {
> > > > /*
> > > > * For unstructured data, we need to use buffer as 1024 bytes to read the data
> > > > */
> > > > opt.setUnstructuredAccess(true);
> > > > opt.setSequentialBlockBufferLength(1024);
> > > > }
> > > >
> > > > int countread = 0;
> > > > do {
> > > > try {
> > > > countread = ef.read(iData);
> > > > if ( countread != -1 ) {
> > > > sb.append(iData.getSdata());
> > > > sb.append(cr).append(lf);
> > > > }
> > > > } catch (DataConversionException e) {
> > > > // TODO Auto-generated catch block
> > > > logger.log(Level.SEVERE, "Filename: " +
> > > > ef.getFileName() + ". " +
> > > > e.getLocalizedMessage(), e);
> > > > }
> > > >
> > > > } while (countread != -1);
> > > >
> > > > /*
> > > > * Compute SHA3
> > > > */
> > > >
> > > > result = HexTools.convertToHex(sha3.encode(
> > > > sb.toString().getBytes(StandardCharsets.UTF_8)));
> > > >
> > > > if (MyProperties.isUppercase())
> > > > {
> > > > result = result.toUpperCase();
> > > > }
> > > > else
> > > > {
> > > > result = result.toLowerCase();
> > > > }
> > > > } catch (EnscribeFileException e) {
> > > > // TODO Auto-generated catch block
> > > > logger.log(Level.SEVERE, "Filename: " +
> > > > ef.getFileName() + ". " +
> > > > e.getLocalizedMessage(), e);
> > > > } finally {
> > > > ef.close();
> > > > sb.setLength(0);
> > > > }
> > > >
> > > > return result;
> > > >
> > > > }
> > > Could anybody help on this ? i want to generate hash from file using SHA3-256 algorithm in vb.net, pls anybody help to get sample code or any idea on this.
> > Googling this, you could potentially use https://github.com/brainhub/SHA3IUF or some other Open Source library, but that assumes your organization can take and use code from GitHub. Or develop your own SHA3 code - it is not that hard to do and well documented.
> I'm a bit interested in this topic due to the fact that we have a MD5 implementation which we need to replace. Haven't gotten to actually do it yet but when I did some research I found a very well structured library called Nettle which has the following punch line "Nettle is a low-level cryptographic library that is designed to fit easily in more or less any context.".
> You'll find it here: https://git.lysator.liu.se/nettle/nettle
>
> Please report back if you're successful and tell us how you solved it!

We implemented MD5, SHA1, SHA256 using the directions from NIST without other external assistance. The techniques are well described. It is not difficult to do if you know C. I cannot share our implementations as they are cryptographic and subject to export controls. Sharing cryptographic code is done at your own risk.
-Randall

Re: SHA-256 Hash Alogrithm

<aa5f7944-9932-44bb-8701-7d3fd2d8c8b7n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=574&group=comp.sys.tandem#574

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:620a:4723:b0:6ee:d4fb:ecf1 with SMTP id bs35-20020a05620a472300b006eed4fbecf1mr36243082qkb.96.1666903259240;
Thu, 27 Oct 2022 13:40:59 -0700 (PDT)
X-Received: by 2002:a81:df08:0:b0:352:f2f2:580c with SMTP id
c8-20020a81df08000000b00352f2f2580cmr45521847ywn.40.1666903259043; Thu, 27
Oct 2022 13:40:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Thu, 27 Oct 2022 13:40:58 -0700 (PDT)
In-Reply-To: <d329b648-7035-4863-81d2-947f370444c5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:1150:11e0:89c2:7603:d1cc:5a2d;
posting-account=6Yg9KQoAAACzOAB0F1up15vc0AKbmZrL
NNTP-Posting-Host: 2600:1700:1150:11e0:89c2:7603:d1cc:5a2d
References: <f173c0d0-aa1c-43ae-b816-906ed474d7c1n@googlegroups.com>
<76aac903-d474-45f2-b1d7-c9f47516ee9fn@googlegroups.com> <ccf44430-e7c8-4461-b196-1cbe5e231954n@googlegroups.com>
<1d87f3cd-7214-4725-9115-c79298beb018n@googlegroups.com> <94e49b01-56e0-4d3f-94a1-46f399643c86n@googlegroups.com>
<d329b648-7035-4863-81d2-947f370444c5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aa5f7944-9932-44bb-8701-7d3fd2d8c8b7n@googlegroups.com>
Subject: Re: SHA-256 Hash Alogrithm
From: j-mar...@pacbell.net (j-ma...@pacbell.net)
Injection-Date: Thu, 27 Oct 2022 20:40:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1970
 by: j-ma...@pacbell.net - Thu, 27 Oct 2022 20:40 UTC

There is another aspect to the question of calculating a hash on a text file. The definition of a text file is specific to the operating system it resides on. When you transfer a text file, the End of Line indicator may be translated, tabs may be translated to spaces, trailing spaces may be truncated, etc. If you transfer it as a text file instead of a binary file, they likely won’t be a bit for bit match.

Jon Marcus

Re: SHA-256 Hash Alogrithm

<2bfc837f-977e-4897-98b6-f362830b6bdbn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=575&group=comp.sys.tandem#575

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:620a:17a5:b0:6ee:9c6a:208d with SMTP id ay37-20020a05620a17a500b006ee9c6a208dmr36647319qkb.337.1666906214298;
Thu, 27 Oct 2022 14:30:14 -0700 (PDT)
X-Received: by 2002:a25:c4c4:0:b0:6cb:e38d:9d7e with SMTP id
u187-20020a25c4c4000000b006cbe38d9d7emr3390133ybf.29.1666906214077; Thu, 27
Oct 2022 14:30:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Thu, 27 Oct 2022 14:30:13 -0700 (PDT)
In-Reply-To: <aa5f7944-9932-44bb-8701-7d3fd2d8c8b7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:3fa6:b400:4128:5fbf:53bc:9db6;
posting-account=6VebZwoAAAAgrpUtsowyjrKRLNlqxnXo
NNTP-Posting-Host: 2607:fea8:3fa6:b400:4128:5fbf:53bc:9db6
References: <f173c0d0-aa1c-43ae-b816-906ed474d7c1n@googlegroups.com>
<76aac903-d474-45f2-b1d7-c9f47516ee9fn@googlegroups.com> <ccf44430-e7c8-4461-b196-1cbe5e231954n@googlegroups.com>
<1d87f3cd-7214-4725-9115-c79298beb018n@googlegroups.com> <94e49b01-56e0-4d3f-94a1-46f399643c86n@googlegroups.com>
<d329b648-7035-4863-81d2-947f370444c5n@googlegroups.com> <aa5f7944-9932-44bb-8701-7d3fd2d8c8b7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2bfc837f-977e-4897-98b6-f362830b6bdbn@googlegroups.com>
Subject: Re: SHA-256 Hash Alogrithm
From: rsbec...@nexbridge.com (Randall)
Injection-Date: Thu, 27 Oct 2022 21:30:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2393
 by: Randall - Thu, 27 Oct 2022 21:30 UTC

On Thursday, October 27, 2022 at 4:41:00 p.m. UTC-4, j-ma...@pacbell.net wrote:
> There is another aspect to the question of calculating a hash on a text file. The definition of a text file is specific to the operating system it resides on. When you transfer a text file, the End of Line indicator may be translated, tabs may be translated to spaces, trailing spaces may be truncated, etc. If you transfer it as a text file instead of a binary file, they likely won’t be a bit for bit match.
>
> Jon Marcus

Hi Jon,

If you use NSGit (T1198), the hash calculation is independent of whether you are in Guardian or OSS or Windows. We made provision for supplying an independent form of the file to the git hash-object function. That might solve the OP issue.

Regards,
Randall

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor