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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:41:31+00:00 2026-06-03T06:41:31+00:00

//Encryption of pass-phrase char passReverse(char usrPass[]){ char newPass[pSize]; int value; int randNum; int rand_NumOut;

  • 0
//Encryption of pass-phrase
char passReverse(char usrPass[]){
    char newPass[pSize];
    int value;
    int randNum;
    int rand_NumOut;

    //Random number generation
    srand(time(0));
    randNum = rand();
    rand_NumOut = ((randNum %12)+2);
    //Reversing array for-loop
    for (int i=0; i<pSize && usrPass[i] != '\0'; i++){
        char letter = usrPass[i];
        newPass[i] = letter;
        int maxVal = strlen(usrPass);
        if (maxVal >=0){
            newPass[i] = usrPass[(maxVal-1)-i];
        }
        cout << newPass[i];
        value = i;
    }
    return value;
}

Ideally the rand_NumOut would be placed in newPass[] immediately after the last loop.

The problem I have run into is that when placed in the for-loop, of course, rand_NumOut is placed after every char in the array, and when outside of the loop, I can’t place it in the array’s content.

Suggestions?

  • 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-06-03T06:41:32+00:00Added an answer on June 3, 2026 at 6:41 am

    at the end of the for loop simply add the lines

    if(usrPass[i+1]=='\0')
    {
    //code to insert rand_NumOut
    //output rand_NumOut
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm an encryption novice trying to pass some values back and forth between systems.
public class Encryption { private static final int[] encrypt = {2, 9, 3, 4,
public class Encryption { private static final int[] encrypt = {2, 9, 3, 4,
Weblogic 10.3.2 uses SHA-1 (and others) for pass encryption. For example the following password:
I have written a java utility for key pair generation for RSA encryption. But
Encryption The encryption is done with Stanford Javascript Crypto Library (SJCL). Below is a
Following encryption and decryption algorithms are called via powershell and in a sharepoint application
What encryption method does the .NET FormsAuthentication.Encrypt() method use? There's no mention in the
Is that any encryption algorithmn which gives limited cipher characters for any sort of
I am using AES encryption and decryption using java. And I use Appache commons

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.