How to resolve the algorithm SHA-256 step by step in the Oberon-2 programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm SHA-256 step by step in the Oberon-2 programming language
Table of Contents
Problem Statement
SHA-256 is the recommended stronger alternative to SHA-1. See FIPS PUB 180-4 for implementation details. Either by using a dedicated library or implementing the algorithm in your language, show that the SHA-256 digest of the string "Rosetta code" is: 764faf5c61ac315f1497f9dfa542713965b785e5cc2f707d6468d7d1124cdfcf
Let's start with the solution:
Step by Step solution about How to resolve the algorithm SHA-256 step by step in the Oberon-2 programming language
Source code in the oberon-2 programming language
MODULE SHA256;
IMPORT
Crypto:SHA256,
Crypto:Utils,
Strings,
Out;
VAR
h: SHA256.Hash;
str: ARRAY 128 OF CHAR;
BEGIN
h := SHA256.NewHash();
h.Initialize;
str := "Rosetta code";
h.Update(str,0,Strings.Length(str));
h.GetHash(str,0);
Out.String("SHA256: ");Utils.PrintHex(str,0,h.size);Out.Ln
END SHA256.
You may also check:How to resolve the algorithm Fermat pseudoprimes step by step in the Nim programming language
You may also check:How to resolve the algorithm Repeat step by step in the Ursa programming language
You may also check:How to resolve the algorithm Currency step by step in the AppleScript programming language
You may also check:How to resolve the algorithm Copy a string step by step in the Vim Script programming language
You may also check:How to resolve the algorithm Rename a file step by step in the PureBasic programming language