LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Python Modules

    Employee
    Posted 06-10-2012 08:46

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: xathras

    Hi,

    Is it ok to install additional python modules to your code base? or is there licensing impacts?

    For example, I'm looking at secure password generation, and rather than re-inventing the wheel, it would be good to use the passlib python modules specifically passlib.hash.pbkdf2 which would give me an excellent crypto to work with.

    http://packages.python.org/passlib/l...f2_digest.html

    If so, is it as simple as finding the python executable and running pip / easy_install?

    Regards
    Wayne


  • 2.  RE: Python Modules

    Employee
    Posted 06-13-2012 12:04

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rboccuzzi

    It is fine in terms of licensing. You would need to set up your environment and then you can use python to install. To do the setup, you would either need to source the lavastorm.csh or setBrainEnv.bat files appropraitely, depending on environment. Please remember, this is something you would need to "support" yourself, as you are installing external libraries, and you would have to configure/install again upon upgrades (probably, but not definitely).

    Cheers
    Rich


  • 3.  RE: Python Modules

    Employee
    Posted 10-25-2012 12:47

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rboccuzzi

    Hey Wayne, I just wanted to drop a not here, in case this wasn't clear. I thought I would just give you some step by step instructions, at least for Windows.

    You need to be running in cmd as Administrator. Below is what I typed is in italics and underlined:


    C:\Users>cd C:\Program Files (x86)\Lavastorm\LAE 4.5
    C:\Program Files (x86)\Lavastorm\LAE 4.5>setBrainEnv.bat
    BRAIN Environment configured:


    Install : C:\Program Files (x86)\Lavastorm\LAE 4.5
    BRAIN : C:\Program Files (x86)\Lavastorm\LAE 4.5
    Java : C:\Program Files (x86)\Lavastorm\LAE 4.5\platform\windows-x86-32\java
    Python : C:\Program Files (x86)\Lavastorm\LAE 4.5\platform\windows-x86-32\python
    Scratch : C:/BRAINscratch
    Temp : "C:/BRAINscratch/tmp"


    Temporary files, logs, deployed graphs, and
    backup files will be in the Scratch Directory


    C:\Program Files (x86)\Lavastorm\LAE 4.5>which python
    /cygdrive/c/Program Files (x86)/Lavastorm/LAE 4.5/platform/windows-x86-32/python/python


    C:\Program Files (x86)\Lavastorm\LAE 4.5>cd \tmp


    C:\tmp>ls
    passlib-1.6.1.tar.gz


    C:\tmp>tar -zxf passlib-1.6.1.tar.gz


    C:\tmp>cd passlib-1.6.1


    C:\tmp\passlib-1.6.1>python setup.py install
    running install
    running bdist_egg
    running egg_info
    [stuff deleted]
    Processing dependencies for passlib==1.6.1
    Finished processing dependencies for passlib==1.6.1
    C:\tmp\passlib-1.6.1>

    That should be it, ideally. I didn't test anything, but I believe it installed fine. And this same thing should be essentially what you do under Linux, only you would source the lavastorm.csh file in the installation directory, under etc...unless your distribution has been modified, then you would need to set up your environment exactly as you do before running the server; let me know if you need more help on that.

    Cheers
    Rich


  • 4.  RE: Python Modules

    Employee
    Posted 10-25-2012 14:24

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: xathras

    Hi Rich,

    Your example on windows helped me progress this for linux, here is what i did:

    Navigate to: /opt/software/lae/4.5.4/platform/linux-x86-64/python/bin
    Copy over my passlib install folders.
    Ran the following command: [lae454@til-bl-lap-02 bin]$ python ./passlib-1.6.1/passlib-1.6.1/setup.py install

    I have attached a dummy example for others.

    For those that don't know, for people whom need to have secure data, you may want to encrypt, standard hashing algorithms are a good way, but using passlib extends that security.
    As an example.

    The word: securekey in SHA1 is always: b6240b1a3f78a9fd4280fbd31b022573a0af7c4d, not matter how many times I refresh.
    Whereas, if i use passlib with SHA1, salt and itterations, there is never a collission:

    e.g. from Attempt 1 to 3 below, see how they're different:
    Pass 1: $sha1$40000$2L3sVEZE$EdEfD9yVzaHVQh4WhmqncCIfhu0l
    Pass 2: $sha1$40000$1PICtgMd$spPMnQtY7jVPcdIP/PGz5f6KVZuj
    Pass 3: $sha1$40000$4h8qZlRq$n2jnEH1dpZfNRgPTB0APFpB.Cb32

    This maybe over kill for some, but for those whom have very sensitive data, I highly recommend.

    Wayne
    Attachments:
    passlibPythonExample.brg
    passlibPythonExample.brp