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 7188493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:05:48+00:00 2026-05-28T19:05:48+00:00

I found a lua aes solution on the web a while ago. And have

  • 0

I found a “lua aes” solution on the web a while ago. And have some concern about its safety.

It states that:

— Do not use for real encryption, because the password is easily viewable while encrypting.

It says this at its “file encryption test” script.

My questions are:

Why is that, how is it any different from encrypting a string and writing it to a file?

How could it be viewable while encryption? Is it viewable after encryption too?

Basically, Is it safe to use or not?

Is there anyone who can confirm this who has used it? I mailed the original developer but the email address was invalid.

Should I be using it at all?

  • 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-28T19:05:49+00:00Added an answer on May 28, 2026 at 7:05 pm

    I assume there are two reasons why that recommendation was made:

    1. Strings are immutable in Lua, so there is no way to overwrite a string with different data
      once it’s created.
    2. In Lua, objects are garbage collected. The garbage collector runs only at certain points in
      the program, and the application has no way of telling when the garbage collector will run after there are no more references to the object. Until then, the password string will remain in memory by point 1.

    See Java’s case, which is similar to Lua:

    Why is char[] preferred over String for passwords?

    As you can see there, using char arrays instead of strings is a better way to store passwords, since arrays are mutable and can be reinitialized to zero when done.

    The closest Lua equivalent to a char array is a table filled with numbers. Here the password is stored as a table, rather than a string, where each element in the table consists of the integer representation of each character. For example, "pass" becomes {0x70,0x61,0x73,0x73}. After the table containing the password is used to encrypt or decrypt, it is filled with zeros before it’s unreachable by the program and eventually gets garbage collected.


    According to your comment, I may have misunderstood. Maybe the “file encryption test” stores the password in plain text along with the encrypted file, allowing anyone with access to the file, even attackers, the ability to trivially decrypt it. The points above still apply, though. This is still only a guess, however; I can’t know exactly what you mean unless you provide a link to the encryption library you mention.


    I’ve taken a look at the AES library and the concern about the password being “easily viewable” occurs because the user types the password in plain text, through the command line or terminal, in order to start the Lua program, even though the output of the program contains only cipher text. A slightly more secure way of providing the password would be not to show the input (as is done in sudo) or to mask the input with dots or stars (as is done in many Web pages).

    Either that or the points given above are perhaps the only logical explanation.

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

Sidebar

Related Questions

I've found some places on the web saying that operators in Lua are overloadable
Found some old code, circa VS 2003. Now I have just VS 2008 (SP1)
I was reading the lua manual (looking for something) and I found out that
I have found myself having to turn a chunk of Lua code into a
I'm trying to compile a lua script that calls some exported functions, save the
I use a cluster of about 30 machines that have all recently been reconfigured
found a interesting problem during testing our web application. I have application on localhost
I have a class that is wrapped with swig, and registered with lua. I
I'm using a graphics library that lets you program in Lua. I have a
There is only one public library for binding Lua to Ada I have found

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.