LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-27-2023, 06:05 PM   #1
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Rep: Reputation: Disabled
Slackware - Chromium cookie value encryption


Running Slackware15 pretty clean install
I use Seamonkey and Firefox to get my investment info from a web site that puts some data in its cookies.
I have sqlite scripts (jython ) that make use of this info.
I have tried using chromium but the cookie values are encrypted for some reason.
Is there some way to get chromium to stop doing this ?
or
How do I decrypt these values on slackware. I have tried cookieCheats with python3 but no luck.
I'm not sure where Chrome is putting the encryption/decryption key
 
Old 01-27-2023, 08:29 PM   #2
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
I can't answer your question directly, but maybe I can help? I struggled for a long time reliably getting stock quotes. Finally I settled on using https://www.tiingo.com/. You have to register (it's free) to get an API key, but then you can programmatically pull down data. I just grab end-of-day prices for tickers I'm interested in and the following scripts creates a *.qif file I then import into KMyMoney.

I manually edit startDate and endDate each time before running. This is get_stock_prices.py:
Code:
#!/usr/bin/env python3

from get_tiingo_quotes import get_data
from datetime import date
import requests
import re
import csv

startDate = date(2022, 11, 22)
endDate =   date(2022, 12, 27)
symbols = [
        'BND',
        'BNDX',
        'IXUS',
        'SCHB',
        'VTI',
        'VXUS',
        'VTIAX',
        'VTSAX',
        ]

with open('import.qif', 'w') as file:
    file.write('!Type:Prices\n')

for symbol in symbols:
    # Get data
    data = get_data(symbol, startDate, endDate)
    for i in range(0, len(data)):
        date = data[i]['date'][0:10]
        price = data[i]['close']
        with open('import.qif', 'a') as file:
            file.write('"%s",%.4f,"%s"\n' % (symbol, price, date))

with open('import.qif', 'a') as file:
    file.write('^\n')
And it relies on get_tiingo_quotes.py:
Code:
#!/usr/bin/env python3

import requests

api_key = "<your_api_key>"

def get_data(symbol, start_date, end_date):
    from datetime import date

    headers = {
            'Content-Type': 'application/json'
            }

    if end_date == date.today():
        end_date_str = ""
    else:
        end_date_str = "&endDate=%s" % end_date.isoformat()
    url = "https://api.tiingo.com/tiingo/daily/%s/prices?startDate=%s%s&token=%s" % (symbol, start_date.isoformat(), end_date_str, api_key)
    requestResponse = requests.get(url, headers=headers)
    return requestResponse.json()


if __name__ == '__main__':
    import sys
    from datetime import date, timedelta
    end_date = date.today()
    start_date = end_date - timedelta(days=10)

    if len(sys.argv) == 1:
        print("\nUsage: get_tiingo_quotes.py SYMBOL [SYMBOL...]\n\n")
    else:
        for i in range(1, len(sys.argv)):
            symbol = sys.argv[i]
            print("---------------------------------------------")
            print("Getting %s" % (symbol))
            results = get_data(symbol, start_date, end_date)
            print(results)
 
1 members found this post helpful.
Old 01-27-2023, 09:38 PM   #3
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
Thanks
I use Moneydance , www.Stockwatch.com and Jython.
Everything works great with Seamonkey and Firefox its just the Chrome cookies that cause problems.
Stockwatch does US and Canadian Stocks and you need to have an account with them.
 
Old 01-29-2023, 12:00 PM   #4
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
I was unable to figure this out.
However I determined that kwallet was being opened by Chromium and not being used for anything I could determine.
I wonder what Chromium was looking in there for ?
I also changed network->connections->Wi-Fi Security to "not encrypted"
I disabled the Kwallet subsystem with the Kwallet Manager
Now I don't have to type in a password again on kwallet every time I reboot.
removepkg chromium-99.0.4844.74-x86_64-1alien
removepkg chromium-ungoogled-109.0.5414.119-x86_64-1alien
I have many other ways of getting unencrypted cookies from the web sites I use.
These web sites send me this info over https for only me to use.
I also already have a home brew system of keeping track of my passwords.
For example my wifi passwords are on sticky notes on the back of a certain cupboard door in the kitchen.
will close this thread
 
  


Reply

Tags
chrome browser, slackware 15.0



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 when trying x11 forwarding Sean1988 Linux - Newbie 2 05-12-2014 05:35 AM
Chromium Cookie Mystery on Linux wait_a_minute Linux - General 8 08-14-2013 04:54 AM
strange value assignments variable = value, value?? ostrow30 Programming 2 07-24-2011 07:59 AM
difference between value *value and value * value PoleStar Linux - Newbie 1 11-26-2010 03:37 PM
password and cookie encryption DamianS Programming 1 11-03-2006 07:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration