Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6882651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:16:50+00:00 2026-05-27T05:16:50+00:00

I am trying to perform non-linear functions on bytes to implement SAFER+. The algorithm

  • 0

I am trying to perform non-linear functions on bytes to implement SAFER+. The algorithm requires computing base-45 logarithm on bytes, and I don’t understand how to do it.

log45(201) = 1.39316393

When I assign this to a byte, the value is truncated to 1, and I can’t recover the exact result.

How am I supposed to handle this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:16:51+00:00Added an answer on May 27, 2026 at 5:16 am

    Cryptography often uses prime fields, in this case, GF(257). Create an exponentiation table that looks like this:

    exp | log
    ----+----
      0 |   1
      1 |  45
      2 | 226
      3 | 147
    ... | ...
    128 |   0
    ... | ...
    255 |  40
    ---------
    

    The “log” values are 45exp % 257. You’ll need an arbitrary precision arithmetic library with a modPow function (raise a number to a power, modulo some value) to build this table. You can see that the value for “exp” 128 is a special case, since normally the logarithm of zero is undefined.

    Compute the logarithm of a number by finding the it in the “log” column; the value in the “exp” column of that row is the logarithm.

    Here’s a sketch of the initialization:

    BigInteger V45 = new BigInteger(45);
    BigInteger V257 = new BigInteger(257);
    byte[] exp = new byte[256];
    for (int idx = 0; idx < 256; ++idx)
      exp[idx] = BigInteger.ModPow(V45, new BigInteger(idx), V257) % 256;
    byte[] log = new byte[256];
    for (int idx = 0; idx < 256; ++idx)
      log[exp[idx]] = idx;
    

    With this setup, for example, log45(131) = log[131] = 63, and 4538 = exp[38] = 59.

    (I’ve never written C#; I’m just guessing from the BigInteger documentation; there are likely to be errors with the data types.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to perform some calculations on a non-directed, cyclic, weighted graph, and I'm
I am certain this is non-conventional, however I am trying to perform the following:
I'm trying perform a relatively basic TCP socket send/receive operation on Windows CE using
Trying to perform a single boolean NOT operation, it appears that under MS SQL
I'm trying to perform a LINQ query on a DataTable object and bizarrely I
I'm trying to perform a SQL query through a linked SSAS server. The initial
I'm trying to perform a bitwise NOT in SQL Server. I'd like to do
I'm trying to perform a simple LINQ query on the Columns property of a
I'm trying to perform a simple INSERT and return the identity (auto-incrementing primary key).
I am trying to perform some unit testing on the iphone but for some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.