BBC BASIC for Windows
« Randomness »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:53pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Randomness  (Read 690 times)
KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Randomness
« Thread started on: Jan 19th, 2017, 10:14am »

Does anyone know whether the RND algorithm has changed at all over the years?

The reason I ask is because I have an encryption program I wrote which uses RND. Enter the password, the program converts it to a numeric value, then seeds RND with the negative value. In theory every run of RND should produce the same numbers.

It has worked fine, but recently I tried to open an old document that had been encrypted with this method and the first couple of lines decrypted just fine, but the rest was garbage.

I'm running 6.02, but still have 5.95 and the same problem occurs with both.
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: Randomness
« Reply #1 on: Jan 19th, 2017, 1:55pm »

Not as far as I know - and I'd be very surprised if Richard changed it without notice, for exactly this kind of reason. You could ask him directly, or on the other forum.

I think it's a linear congruential generator, and I'm sure we've discussed the algorithm in the past - you could probably find the equation on the groups.io site (which has all the old Yahoo postings), if it's not on this one, allowing you to implement it directly.

Do you have any other files encrypted the same way? Do they work? I'd have thought the more likely explanation is a corruption of the document file - particularly if the first few lines translate correctly.

If you add or remove one character at the point where the translation breaks down, can you rescue it?

Best wishes,

D
User IP Logged

KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Re: Randomness
« Reply #2 on: Jan 19th, 2017, 7:55pm »

Thanks for the suggestion. Yes, I have lots of other files encrypted in this way and all without problems - but they are more recent that this one.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls