string encryption with Keccak256 in app Flutter App [duplicate]

As you know, a hash takes in bytes and emits bytes. So, to hash a string, you need to convert it first to bytes using a character encoding - perhaps ASCII or UTF8.

To use pointycastle import the package, construct the right digest and process the bytes.

import 'dart:convert';
import 'dart:typed_data';

import 'package:pointycastle/export.dart';

void main() {
  final digest = KeccakDigest(256);
  final hash = digest.process(ascii.encode('input'));
  print(hash);
}